Need help with script

local Tool = script.Parent
local plr = game.Players.LocalPlayer
local SickValue = plr.PlayerGui.Sick.Value

Tool.Activated:Connect(function()
	if SickValue == true then
		SickValue = false
	elseif SickValue == false then return end
end)

Tool.Unequipped:Connect(function()
	SickValue = false 
end)

Hi everyone! This is a localscript in a tool in which, upon equipping it, it would edit and turn a “Sick” value to false, which I have put in my PlayerGUI.

2 Likes

What’s the issue you’re currently having?

1 Like

It doesn’t change my sick value to false

1 Like

Are you getting any errors? Have you tried printing the Sick value to see what it says

1 Like

hang on, does it have to be a normal script?

1 Like

If you’re gonna be altering LocalPlayer, use LocalScript

1 Like

Hello, this looks like an issue with the “Value”, try using this code and let me know:

local Tool = script.Parent
local plr = game.Players.LocalPlayer
local SickValue = plr.PlayerGui:WaitForChild("Sick")

Tool.Activated:Connect(function()
	if SickValue.Value == true then
		SickValue.Value = false
	elseif SickValue.Value == false then return end
end)

Tool.Unequipped:Connect(function()
	SickValue.Value = false 
end)

If you using a tool with no Handle or parts, make sure RequiresHandle value is on false.

was under the impression however that localscripts cant edit values