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?

3 comments
I'll check that out
I'm afraid that still hasn;t fixed my previous problem, the script still only works when it has been dragged out then in, even when changed.
Hm. Well, if that isn't the problem, then your problem is most likely something with the timing on things loading in, perhaps you have attempted to access the Gui before it has loaded, etc. It makes no sense when you look at the script, but I've had a lot of experience and frustrations with things not loading. I suggest just adding a wait(2) at the beginning to give you time. Inefficient, but it's