LordRahl3000 Posted January 21, 2017 Share Posted January 21, 2017 I was recently watching a tutorial on spawning and I'd like to revise the way I do it. In the video, he used a collision trigger which is unfortunately useless in my game. I'm trying to write my own script and trigger it via flow graph. The FPSPlayer.lua fortunately has a tab within the flowchart that says "On Dead". I'd like to use it to trigger my player spawner. This is my very first attempt at writing my own. Having an issue with signifying the player as the entity to be spawned. Quote Link to comment Share on other sites More sharing options...
LordRahl3000 Posted January 21, 2017 Author Share Posted January 21, 2017 Just realized I put this in the wrong category. I should have posted it in programming. Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted January 21, 2017 Share Posted January 21, 2017 Your first function is not in a correct syntax at all. You need something more like this. Note that it is not complete. function Script:Respawn()--in --get spawnPos --get player entity --place the player entity at the spawn pos player:SetPosition(spawnPos) end 1 Quote Link to comment Share on other sites More sharing options...
Thirsty Panther Posted January 21, 2017 Share Posted January 21, 2017 I had problems with the On-Death function in the past. Why doesn't a trigger work for you in your game? Are you using Aggrors/Jorns scripts? 1 Quote Link to comment Share on other sites More sharing options...
LordRahl3000 Posted January 21, 2017 Author Share Posted January 21, 2017 Thankyou Aggror! That gives me an idea anyway. I appreciate it! The reason I don't want a collision trigger deciding my respawn is because I'm not worried about just falling. When the player falls, HP drops to 0. So using the on death trigger takes care of everything in one go I would think. It allows the player to respawn when a collision trigger isn't viable. For instance, An FPS game may have a collision trigger set for deep water or a deep chasm but what about when they are killed by an enemy npc? You'd be stuck laying there...I havn't been using any custom scripts. I havn't been able to find any except for what's in the workshop, even those don't work... Quote Link to comment Share on other sites More sharing options...
AggrorJorn Posted January 23, 2017 Share Posted January 23, 2017 The collision trigger is just a simple example. If the Dead trigger from the FPS player is usefull for you, you go for it. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.