Okay so recently I have been trying to disable a sprint script in StarterGui when you equip a tool. The script Ive been using is this:
local Tool = script.Parent
local Start = game.StarterGui
function onEquippedLocal()
Start:FindFirstChild("ShiftToSprint").Disabled = true
end
function onUnequippedLocal()
Start:FindFirstChild("ShiftToSprint").Disabled = false
end
Tool.Equipped:connect(onEquippedLocal)
Tool.Unequipped:connect(onUnequippedLocal)
But for some reason, it does not work. As the sprint script still works after its disabled somehow.
So instead I tried to do another script where it would change the parent of the sprint script to a place where it wouldn’t work when tool is equipped, like workspace.
It changed the parent of the script to workspace, but somehow it still kept working???
Other quite similar posts like this just doesn’t work or doesn’t help me as they use the disable property which for some reason, doesn’t even disable the line of code inside.
I am quite new at scripting. So If there is anybody that could help me, that would be very much appreciated.