FantasyGamer

Ugh idk

Sep 13th, 2017
138
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.06 KB | None | 0 0
  1. -- ServerScriptService
  2.  
  3.  
  4. local rep = game:GetService("ReplicatedStorage")
  5. local on = rep:FindFirstChild("TrailOn") or Instance.new('RemoteEvent',rep)
  6. local off = rep:FindFirstChild("TrailOff") or Instance.new('RemoteEvent',rep)
  7. on.Name,off.Name = 'TrailOn','TrailOff'
  8.  
  9. function command(player, chatted)
  10. local character = game.workspace:FindFirstChild(player.Name)
  11.  
  12. if chatted:lower():sub(1,('/trail on'):len()) == "/trail on" then
  13. print("Trail on")
  14. on:FireClient(player)
  15.  
  16. elseif chatted:lower():sub(1,('/trail off'):len()) == "/trail off" then
  17. print("Trail off")
  18. off:FireClient(player)
  19. end
  20.  
  21. end
  22.  
  23.  
  24. function NewPlayer(player)
  25. wait()
  26. player.Chatted:connect(function(message)
  27. command(player, message)
  28. end)
  29. end
  30.  
  31.  
  32. game.Players.ChildAdded:connect(NewPlayer)
  33.  
  34. --StarterPack
  35.  
  36. local rep = game:GetService("ReplicatedStorage")
  37. local on = rep:WaitForChild("TrailOn")
  38. local off = rep:WaitForChild("TrailOff")
  39.  
  40.  
  41. on.OnClientEvent:connect(function()
  42. print("on")
  43. end)
  44.  
  45. off.OnClientEvent:connect(function(thing)
  46. print("off")
  47. end)
Advertisement
Add Comment
Please, Sign In to add comment