Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Did roblox change something or have I lost all my scripting experience?

Asked by 5 years ago
Edited 5 years ago

This may sound dumb, but why doesn't the text change? (Only changes once)

while true do
    wait(1)
    script.Parent.Text = script.Parent.Amount.Value
end
0
does script.parent.amount's value change? INOOBE_YT 387 — 5y
0
Yeah retrobricks 162 — 5y
0
Everytime you die it adds 1 to the value. retrobricks 162 — 5y
0
is this a server script? where is it? do you change the amount.Value in a local or server script? User#22604 1 — 5y
0
me to FantasticFrontierGuy 33 — 5y

1 answer

Log in to vote
-1
Answered by 5 years ago
if script.ClassName == "LocalScript" then
game:GetService("RunService").Stepped:connect(function()

    script.Parent.Text = tostring(script.Parent.Amount.Value)
end)

else warn("USE A LOCALSCRIPT")

end

0
1. use :Connect not :connect. 2. Use .Changed event instead of RunService 3. The Event should be outside of the conditional statement, it's not good to place a event inside a conditional statement (a simple fix is to change the event) BlackOrange3343 2676 — 5y
Ad

Answer this question