Hello everyone,
I have attempted to make a return script for my DarkRP server but it seems to not work if someone could please help me that would be very helpful
Thank you.
*SCRIPT*
local CATEGORY_NAME = "mrbell11's Return Script"
function ulx.return( calling_ply, target_ply )
if not calling_ply:IsValid() then
Msg( "Sorry This is not Valid #A.\n" )
return
end
if not target_ply:Alive() then
ULib.tsayError( calling_ply, target_ply:Nick() .. " is dead!", true )
return
end
local newpos = LastPos[ target_ply:SteamID() ]
if not newpos then
ULib.tsayError( calling_ply, "Can't find a place to return this Player.", true )
return
end
target_ply:SetPos( LastPos[ target_ply:SteamID() ] )
target_ply:SetLocalVelocity( Vector( 0, 0, 0 ) )
ulx.fancyLogAdmin( calling_ply, "#A returned #T", target_ply )
end
local return = ulx.command( CATEGORY_NAME, "mrbell11's Return Script", ulx.return,
"!return", true )
return:addParam{ type = ULib.cmds.PlayerArg, ULib.cmds.optional }
return:defaultAccess( ULib.ACCESS_ADMIN )
return:help( "Returns a player to previous location." )