Howdy DevForum! I am trying to make a script so that when this IntValue gets a certain amount it will delete these 2 text and will enable these 2 scripts inside a part. I get no errors in the output and dev console. Please help!
local Amount = script.Parent.Parent.AmountBoard.AmountDisplayPart.Amount.Value
if Amount == 550 then
script.Parent.Teleporter.CurrencyGiver.Disabled = false
script.Parent.Teleporter.Teleport.Disabled = false
script.Parent.LockedText:Destroy()
script.Parent.Needed:Destroy()
end
amount.Changed:Connect(function()
if amount.Value == number then
-- do stuff
end
end)
Take value off of the end of your variable, this event only works with instances.
And there’s also,
amount:GetPropertyChangedSignal("Value"):Connect(function()
if amount.Value == number then
-- do stuff
end
end)
The first one fires when any value of the instance has changed, :GetPropertyChangedSignal() allows you to listen for the differences in specific properties.
He asked for a certain amount. The equal operator only works if two numbers are exactly the same. Using this operator, >= allows the script to check if its equal or above.
This does not seem to be working, and .Changed does not work on this value I am pretty sure. And I did try what @KingAchieve said. This is also a regular script not a local script.