Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local player = game.Players.LocalPlayer
- local mouse = player:GetMouse()
- local tool = script.Parent
- local server = tool:WaitForChild("ServerScript")
- local equipped = false
- local spraying = false
- tool.Equipped:Connect(function()
- equipped = true
- end)
- tool.Unequipped:Connect(function()
- equipped = false
- if spraying then
- server.Stop:FireServer()
- end
- end)
- mouse.Button1Down:Connect(function()
- if equipped then
- spraying = true
- server.Start:FireServer()
- end
- end)
- mouse.Button1Up:Connect(function()
- if equipped then
- spraying = false
- server.Stop:FireServer()
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement