Alright so basicaly im making a backrooms game in which i got a int value that if its too low, the player die’s. to prevent the player from dying i made a tool. and it has a script but it doesn’t work. i don’t why.
local tool = script.Parent
local mouse = game.Players.LocalPlayer:GetMouse()
tool.Equipped:Connect(function()
mouse.Button1Down:Connect(function()
workspace.Script.Brain.Value = workspace.Script.Brain.Value + 50
end)
end)
So if i got this right you wanna change value when clicked?
If so you should change the value with server script not local script as it is only visual and server can’t see the changes values are server sided
(Also mouse.Button1Down isn’t needed cuz only way to equip tool is left mouse)
You can add a server script inside the tool and write:
script.Parent.Activated:Connect(function()
--Code here
end)