Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- ServerScriptService
- local rep = game:GetService("ReplicatedStorage")
- local on = rep:FindFirstChild("TrailOn") or Instance.new('RemoteEvent',rep)
- local off = rep:FindFirstChild("TrailOff") or Instance.new('RemoteEvent',rep)
- on.Name,off.Name = 'TrailOn','TrailOff'
- function command(player, chatted)
- local character = game.workspace:FindFirstChild(player.Name)
- if chatted:lower():sub(1,('/trail on'):len()) == "/trail on" then
- print("Trail on")
- on:FireClient(player)
- elseif chatted:lower():sub(1,('/trail off'):len()) == "/trail off" then
- print("Trail off")
- off:FireClient(player)
- end
- end
- function NewPlayer(player)
- wait()
- player.Chatted:connect(function(message)
- command(player, message)
- end)
- end
- game.Players.ChildAdded:connect(NewPlayer)
- --StarterPack
- local rep = game:GetService("ReplicatedStorage")
- local on = rep:WaitForChild("TrailOn")
- local off = rep:WaitForChild("TrailOff")
- on.OnClientEvent:connect(function()
- print("on")
- end)
- off.OnClientEvent:connect(function(thing)
- print("off")
- end)
Advertisement
Add Comment
Please, Sign In to add comment