Hi, thanks for reading to help me.
Basically what I’m trying to figure out is why my value isn’t changing. This is all client side so it shouldn’t be an FE issue as it’s all in their GUI.
local plr = game.Players.LocalPlayer.Name
local repstorage = game:GetService("ReplicatedStorage")
local viewportchar = script.Parent.Parent.Parent.ViewportFrame:WaitForChild(plr.."CLONED")
local event = repstorage:WaitForChild("PlayerAvatarGearClone")
local vesttype = "HiVisVest"
local onornot = script.Parent.Parent.VestOn.Value
script.Parent.MouseButton1Down:Connect(function()
if viewportchar:FindFirstChild(vesttype) == nil and onornot == false then
script.Parent.BackgroundColor3 = Color3.fromRGB(165,165,165)
print("Fired")
event:FireServer(vesttype, "On")
onornot = true
elseif viewportchar:FindFirstChild(vesttype) and onornot == true then
script.Parent.BackgroundColor3 = Color3.fromRGB(66,66,66)
event:FireServer(vesttype, "Off")
onornot = false
end
end)
What it’s supposed to do is check the value (‘VestOn’) and then do the things and switch it to the opposite. I’m not sure what I’ve done and I’ve got myslef into a bit of a pickle lol.
Any help is appreciated ![]()