Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --[[
- _____ ____
- | ___| __ ___ _______ _ __ / ___|___ _ __ ___
- | |_ | '__/ _ \_ / _ \ '_ \| | / _ \| '__/ _ \
- | _|| | | (_) / / __/ | | | |__| (_) | | | __/
- |_| |_| \___/___\___|_| |_|\____\___/|_| \___|
- Lightning speed and strength
- conjured directly from the depths of logic!
- Prismatic-Network 2013 (C) by Psykko
- <--------------------------------------------------------------------------->
- - Developer(s): Psykko
- - Complete: 100%
- - ScriptName: 'CheckpointSystem'
- - Comment: N/A
- <--------------------------------------------------------------------------->
- ]]
- -- Rewritten by Rochet2
- local CD = 20 -- 20 sec
- local LOC = {}
- local function OnChat(event, player, message)
- if (message == "#save") then -- command to save location
- local str = tostring(player)
- local x,y,z,o = player:GetLocation()
- LOC[str] =
- {
- cooldown = (LOC[str] and LOC[str].cooldown) or 0,
- location = {player:GetMapId(),x,y,z},
- }
- player:SendBroadcastMessage("|cffff6060[Prismatic-Network]: |cff00ccffYour Location has been Saved.")
- return false
- elseif (message == "#go") then -- command to teleport to checkpoint
- local str = tostring(player)
- if (LOC[str]) then
- local ctime = os.time()
- if (LOC[str].cooldown < ctime) then
- player:Teleport(table.unpack(LOC[str].location))
- player:SendBroadcastMessage("|cffff6060[Prismatic-Network]: |cff00ccffYou have been Teleported to your Checkpoint. You can use this Command in 10seconds again.") -- text on teleport
- LOC[str].cooldown = ctime + CD
- else
- player:SendBroadcastMessage("|cffff6060[Prismatic-Network]: |cff00ccffPlease wait "..(LOC[str].cooldown - ctime).." seconds to teleport again.") -- text on cooldown
- end
- else
- player:SendBroadcastMessage("|cffff6060[Prismatic-Network]: |cff00ccffYou havent set a Checkpoint yet.") -- text on no saved location
- end
- return false
- end
- end
- RegisterServerHook(16, OnChat)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement