Wulf submitted a new resource:
Respawner - Automatically respawns players after they die
Read more about this resource...
Respawner
Automatically respawns players with permission and optionally wakes them up
Total Downloads: 6,689 - First Release: Oct 22, 2014 - Last Update: Nov 9, 2017
- 5/5, 4 likes
-
Wulf Community Admin
-
And if a person has a sleeping bag, it will appear in it?
-
Wulf Community Admin
All this does is trigger the respawn sequence.
Update: Nope, doesn't appear that they spawn in it. Will do more testing. -
Lol! That walk around to detect players dieing xD!!
-
Code:
[Oxide] 8:37 AM [Error] respawner: [string "respawner.lua"]:11: attempt to index local 'player' (a nil value) at NLua.Lua.ThrowExceptionFromError (Int32 oldTop) [0x00000] in <filename unknown>:0 at NLua.Lua.CallFunction (System.Object function, System.Object[] args, System.Type[] returnTypes) [0x00000] in <filename unknown>:0 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
Last edited by a moderator: Oct 26, 2014 -
Wulf Community Admin
Wulf updated Respawner with a new update entry:
Fix for latest update, support for kill command, and config
-
Wulf Community Admin
Wulf updated Respawner with a new update entry:
Fixed settings not being used properly
-
Wulf Community Admin
Wulf updated Respawner with a new update entry:
Added support for sleeping bags thanks to @Reneb
-
For me using this allowed players to respawn automatically, however they saw the "You have died" spawn selection menu on most respawns.
To get around this I added a line:
Code:function PLUGIN:Respawn(player) spawnTimer = timer.Once(1, function() if self.Config.Settings.SleepingBags ~= "false" then local sleepingBags = self:FindSleepingBagByPlayer(player) if #sleepingBags >= 1 then local sleepingBag = sleepingBags[math.random(1, #sleepingBags)] player.transform.position = sleepingBag.transform.position player.transform.rotation = sleepingBag.transform.rotation player:Respawn(false) end elseif self.Config.Settings.SameLocation ~= "false" then player.transform.position = player.transform.position player.transform.rotation = player.transform.rotation player:Respawn(false) else player:Respawn(true) end player:StartSleeping() --Added:Force the sleeping player back to sleep before waking player:EndSleeping() --This now wakes up every time as intended (instead of "you are dead") end) end
-
Wulf Community Admin
Last edited: Oct 28, 2014 -
If I remove player:StartSleeping while the timer is in, I still 7/10 times "wake up" but I have the death screen in front of me, with it 100% so far not one has messed up. Not sure why it helps in my case, maybe loading times or something like that its not triggering correctly like it is on your side?
I agree though it is duplicating the step, but as facepunch said them selves its a very tricky bug. At least it might help for some like in my case, the reason I added it is because in game to resolve you're dead the issue I had to F1 sleep > wakeup so I replicated that. -
Wulf Community Admin
Wulf updated Respawner with a new update entry:
Hopefully fix random error that makes no sense
-
Wulf Community Admin
Wulf updated Respawner with a new update entry:
Fixed respawning for players with no sleeping bags
-
Wulf Community Admin
Wulf updated Respawner with a new update entry:
Fixed giving of default items from respawning multiple times
-
Code:
[2/25/2015 7:29:53 PM] [Oxide] 7:29 PM [Error] Failed to run a timer. File: respawner.lua Line: 56 : at (wrapper managed-to-native) UnityEngine.Component:get_transform () at BasePlayer.Respawn (Boolean newPos) [0x00000] in <filename unknown>:0 at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object[],System.Exception&) at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] in <filename unknown>:0
-
Wulf Community Admin
Wulf updated Respawner with a new update entry:
Fixed error when sleepers get killed
-
If the spawn increased for example up to 30 seconds
Code:spawnTimer[steamId] = timer.Once(30, function()
After 30 seconds pererespaun console and will give the inscription:
Assertion failed: Stomping old lifeStory -
It keeps respawning back in the death position, even with "SameLocation": "false" set. O.O any idea?
Other problems:
The menu pops up to respawn in sleeping bag if "SleepingBags": "true"
http://puu.sh/iDG85/f4bc65d3a8.jpg
and the Guns get left in the air after death,
http://puu.sh/iDFWU/e00f5c8a06.jpg
[DOUBLEPOST=1435348116][/DOUBLEPOST]Code:7:36 PM [Error] Failed to run a 1.00 timer in respawner File: respawner.lua Line: 33 bad argument #2 to 'random' (interval is empty): at NLua.Lua.ThrowExceptionFromError (Int32 oldTop) [0x00000] in <filename unknown>:0 at NLua.Lua.CallFunction (System.Object function, System.Object[] args, System.Type[] returnTypes) [0x00000] in <filename unknown>:0 at NLua.LuaFunction.Call (System.Object[] args, System.Type[] returnTypes) [0x00000] in <filename unknown>:0 at NLua.Method.LuaDelegate.CallFunction (System.Object[] args, System.Object[] inArgs, System.Int32[] outArgs) [0x00000] in <filename unknown>:0 at LuaGeneratedClass1.CallFunction () [0x00000] in <filename unknown>:0 at Oxide.Core.Libraries.Timer+TimerInstance.Update () [0x00000] in <filename unknown>:0
Last edited by a moderator: Jun 27, 2015 -
Wulf Community Admin
-
Thanks, the respawn in same position is only if your admin. i removed ownerid and it worked fine after that