local RepStorage = game:GetService("ReplicatedStorage")
local CableEvent = RepStorage:WaitForChild("Cable")
local BuildEvent = RepStorage:WaitForChild("Build")
local CableTool = RepStorage:WaitForChild("CableTool")
local BuildTool = RepStorage:WaitForChild("BuildTool")
local ToolEquiped = false
--Tool equiping function
local function EquipAndDequip(tool, plr, ToolOn)
local character = plr.Character
if ToolOn == true then
local CableTool = character:FindFirstChild(tool.Name)
CableTool:Destroy()
ToolOn = false
else
local CableTool = tool:Clone()
CableTool.Parent = character
ToolOn = true
end
return ToolOn
end
CableEvent.OnServerEvent:Connect(function(plr)
--Tool equiping
ToolEquiped = EquipAndDequip(CableTool, plr, ToolEquiped)
end)
BuildEvent.OnServerEvent:Connect(function(plr)
--Tool equiping
ToolEquiped = EquipAndDequip(BuildTool, plr, ToolEquiped)
end)
That is the code, and sorry if its bad i dont have a lot of experience (im happy that i even made this), and i would like to know if this would work on multiplayer, its on a script in serverScriptService
** You are now Level 3! **