Basically is it meant to make the transparency of a frame, dependent on a player's IntValue. The local script is here The
The code in the script:
-- This is a local script local player = game.Players.LocalPlayer -- The local player local sword = player.Folder:WaitForChild("PWSword") -- Wait for this to go into the Player (from another script) --Folder is the model containing it local frame = script.Parent -- The Frame -- Gap if sword.Value>0 then -- If the sword's value is above 0 then frame.Transparency = 1 -- make this frame invisible elseif sword.Value == 0 then -- Otherwise if it is 0 frame.Transparency = 0.2 -- Make it almost Opaque end -- ends that -- Gap sword.Changed:connect(function() -- When the sword's value changes if sword.Value>0 then -- if it is above above 0 then frame.Transparency = 1 -- make this frame invisible elseif sword.Value == 0 then -- Otherwise if it is 0 frame.Transparency = 0.2 -- Make it almost Opaque end -- endy endy end) -- ending my function
READ: The problem is, when I clone it in the player's GUI (with another script) it is normal (without changes to what I set it's base properties as, so wrong if it was above 0), however if I remove it, then put it back in the PlayerGUI (in studio) then it works. Then if I change the value (to 0) nothing happens it just stays at the previous transparency, but if I drag it out and in, it goes dark again, help?
Your problem is that you capitalized the C in :connect
. Lua is case-sensitive.