For some reason the LocalScript is not running. I presume it's because of the functions I used, but I eagerly want to make this script work. For a valid reason.
Please note that "Orange Text" is an ImageLabel , "OrangeTextLabelHitValue" is an
IntValue that tells when the "Orange Text" ImageLabel is supposed to move. ControlFrame is just an ordinary Frame
Structure
-Frame
~~OrangeTextHitValue ~~ControlGui <-- This is where the LocalScript I'm talking about is located.** ~~OrangeText
local ControlFrame = script.Parent local OrangeTextLabel = ControlFrame:WaitForChild("OrangeText") local ControlTrigger = ControlFrame:WaitForChild("OrangeTextHitValue").Value ControlTrigger.Changed:Connect(function() if ControlTrigger == 1 then ControlFrame.Position = UDim2.new(0,0,0,0) OrangeTextLabel.Position = UDim2.new(0,0,0,0) end end) ControlTrigger.Changed:Connect(function() if ControlTrigger == 2 then ControlFrame.Position = UDim2.new(0,0,55,0) OrangeTextLabel.Position = UDim2.new(0,0,-55,0) end end) ControlTrigger.Changed:Connect(function() if ControlTrigger == 3 then ControlFrame.Position = UDim2.new(0,0,110,0) OrangeTextLabel.Position = UDim2.new(0,0,-110,0) end end) ControlTrigger.Changed:Connect(function() if ControlTrigger == 4 then ControlFrame.Position = UDim2.new(0,0,165,0) OrangeTextLabel.Position = UDim2.new(0,0,-165,0) end end) ControlTrigger.Changed:Connect(function() if ControlTrigger == 4 then ControlFrame.Position = UDim2.new(0,0,220,0) OrangeTextLabel.Position = UDim2.new(0,0,-220,0) end end)
Hey JoeRaptor,
local ControlTrigger = ControlFrame:WaitForChild("OrangeTextHitValue").Value; -- Now it has the value in it stored. ControlTrigger.Changed:Connect(function(val) -- First off, this won't even run because the value is constant and events can't be used on numbers like that, it must be used on userdata values. end)
local ControlTrigger = ControlFrame:WaitForChild("OrangeTextHitValue"); ControlTrigger.Changed:Connect(function(val) -- val is the number that it has become. if val == 1 then -- blah blah blah end end)
local ControlTrigger = ControlFrame:WaitForChild("OrangeTextHitValue"); ControlTrigger.Changed:Connect(function(val) if val == 1 then -- blah else if val == 2 then -- blah blah end else if val == 3 then -- blah blah blah else if val == 4 then -- blah blah blah blah end end end end end)
~~ KingLoneCat