• Script to teleport/freeze/godmode.
    4 replies, posted
Hi. I would like a script that will, when you type a command, : teleport the player to a place. give godmode to the player. freeze the player. And when the player types the command again, he gets teleported back to his location, un-godmode and unfreezed. I guess it's like, on the command, you have to get the position, save it in a varible, and then teleport, god, freeze, when the player is back, you get the position from the varible.
[lua] local telepos = Vector(10,10,10) concommand.Add('telefreezegod', function(ply, cmd, args) if(!ply:IsAdmin() || !args[1]) then return end for k, v in ipairs(player.GetAll()) do if(string.find(string.lower(v:Nick()), string.lower(args[1]))) then if(!v.OldPos) then v.OldPos = v:GetPos() v:SetPos(telepos) v:Lock() v:GodEnable() else v:UnLock() v:GodDisable() v:SetPos(v.OldPos) v.OldPos = nil end end end end) [/lua]
[QUOTE=CombineGuruX;25631394][lua] local telepos = Vector(10,10,10) concommand.Add('telefreezegod', function(ply, cmd, args) if(!ply:IsAdmin() || !args[1]) then return end for k, v in ipairs(player.GetAll()) do if(string.find(string.lower(v:Nick()), string.lower(args[1]))) then if(!v.OldPos) then v.OldPos = v:GetPos() v:SetPos(telepos) v:Lock() v:GodEnable() else v:UnLock() v:GodDisable() v:SetPos(v.OldPos) v.OldPos = nil end end end end) [/lua][/QUOTE] Where do I enter where they should get teleported?
[QUOTE=Zeroi;25634339]Where do I enter where they should get teleported?[/QUOTE] Have you tried line 1
[QUOTE=Willox;25634472]Have you tried line 1[/QUOTE] Vector? Shouldn't I type like "getpos" in console, and enter the output?
Sorry, you need to Log In to post a reply to this thread.