Taser script not reviving player after been tased! (I have tried everything!)
13 replies, posted
[url]http://pastebin.com/T8pbJUji#[/url]
Basically I made a timer to revive the player on line "109" and no matter how I do the code or the function I get this error [url]http://i.imgur.com/F3Tj7Ux.png[/url]
Note: This is not my script and I take no credit for it!
I have seriously tried everthing to fix it and I have come here as a last resort!
[CODE]self:taserevive[/CODE]
Should be changed to...
[CODE]self:taserevive()[/CODE]
@Angry Pepper
After doing that I now get this error [url]http://i.imgur.com/S9d5Uzx.png[/url]
I have litrelly tried everything and I have no idea why it won't work did I miss something out like that?
[editline]25th June 2014[/editline]
I now changed the code to this...
timer.Create( "revivedelay", 10, 1, function()
if not IsValid(rag) or not IsValid(self) then return end self:taserevive()
end)
end
And I have managed to get rid of all the errors but the player still does not respawn?!?!?!?!?!
Anyone got any ideas?
I think it is like Angry said
timer.Create( "revivedelay", 10, 1, function()
if not IsValid(rag) or not IsValid(self) then return self:taserevive
end)
it should be
timer.Create( "revivedelay", 10, 1, function()
if not IsValid(rag) or not IsValid(self) then return self:taserevive()
end)
You do realise that
[lua]if !ent then return end[/lua]
should be
[lua]if ent == nil then return end[/lua]
[lua]if !ent then[/lua]
Checks if it isn't the bool (boolean true/false) true hence stopping the function if you give in anything but the bool true
Also please use lua or code bb tags e.g.
[noparse][lua]code here[/lua]
or
[code]code here[/code][/noparse]
!ent will return true if the ent is nil.
What he really should have there is !IsValid( ent )
He already has a check for that further down, I was just correcting a mistake he had made further up. If you read op and the code you would know that
I did all of this and the Player just stays a ragdoll and I have no idea why?!?
My latest code (Maybe I made a mistake in adding the latest code?): [url]http://pastebin.com/0NURzr7m[/url]
[editline]25th June 2014[/editline]
Does anyone know what's wrong with it?
I have tried everything now and I have no idea where to go from here? What do I do!
This is my latest code: [url]http://pastebin.com/0NURzr7m[/url]
Is there any reason why the player won't respawn after been shot?!?!?!?
I am at the point where I would be willing to pay :( I have tried everything
try creating the revive timer inside the revive function instead of inside primary attack, i don't think swep primaryattack plays nice with timers that don't involve the swep itself
@legandofrobbo
That did not work and I did not expect it to :D
But seriously can anyone give me a viable solution I am willing to pay for this!
This is my latest code: [url]http://pastebin.com/0NURzr7m[/url] (Same as last time!)
I have looked on all the wiki's to do with timer's and everthing maybe I missed out somewhere else other than where I said?!?
This is my latest code: [url]http://pastebin.com/0NURzr7m[/url] (Same as last time!)
I think this may work: [url]http://pastebin.com/6das1KHQ[/url]
Sorry, you need to Log In to post a reply to this thread.