Advertisement
Guest User

Untitled

a guest
Feb 20th, 2017
127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 0.89 KB | None | 0 0
  1. SERVER SCRIPT:
  2.  
  3. local RE = script.Parent:WaitForChild("RemoteEvent")
  4. local tool = script.Parent
  5.  
  6. RE.OnServerEvent:connect(function(player, request)
  7.     if request == 'field' then
  8.         local s = game.ReplicatedStorage:WaitForChild("SpiritField")
  9.         local sc = s:Clone()
  10.         sc.Parent = game.Workspace
  11.         sc.Position = player.Character.RightFoot.Position
  12.         local f = Instance.new("ForceField", player.Character)
  13.         wait()
  14.         if player.Character:WaitForChild("ForceField") then
  15.             script.Disabled = true
  16.             wait(10)
  17.             script.Disabled = false
  18.             sc:Destroy()
  19.             f:destroy()
  20.         end
  21.     end
  22. end)
  23.  
  24. LOCAL SCRIPT:
  25. local RE = script.Parent:WaitForChild("RemoteEvent")
  26. local tool = script.Parent
  27. local mouse = game.Players.LocalPlayer:GetMouse()
  28.  
  29. script.Parent.Equipped:connect(function()
  30.     if script.Parent.Equipped then
  31.         mouse.Button1Down:connect(function()
  32.             RE:FireServer('field')
  33.         end)
  34.     end
  35. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement