Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- SERVER SCRIPT:
- local RE = script.Parent:WaitForChild("RemoteEvent")
- local tool = script.Parent
- RE.OnServerEvent:connect(function(player, request)
- if request == 'field' then
- local s = game.ReplicatedStorage:WaitForChild("SpiritField")
- local sc = s:Clone()
- sc.Parent = game.Workspace
- sc.Position = player.Character.RightFoot.Position
- local f = Instance.new("ForceField", player.Character)
- wait()
- if player.Character:WaitForChild("ForceField") then
- script.Disabled = true
- wait(10)
- script.Disabled = false
- sc:Destroy()
- f:destroy()
- end
- end
- end)
- LOCAL SCRIPT:
- local RE = script.Parent:WaitForChild("RemoteEvent")
- local tool = script.Parent
- local mouse = game.Players.LocalPlayer:GetMouse()
- script.Parent.Equipped:connect(function()
- if script.Parent.Equipped then
- mouse.Button1Down:connect(function()
- RE:FireServer('field')
- end)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement