Untitled

 avatar
unknown
plain_text
20 days ago
619 B
6
Indexable
local player = game.Players.LocalPlayer
local mouse = player:GetMouse()

local tool = script.Parent
local server = tool:WaitForChild("ServerScript")

local spraying = false
local equipped = 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)
Editor is loading...
Leave a Comment