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

This function doesen't execute?

Asked by
drew1017 330 Moderation Voter
9 years ago
game.Players.LocalPlayer.Character.functiondummy.Value  = math.random(1, 99999999)

game.Players.LocalPlayer.Character.functiondummy.Changed:connect(function()

(everything with the function itself is fine, there are no errors)

This function just plain out doesen't execute even with the obvious presented above. Any fixes?

1 answer

Log in to vote
0
Answered by
Goulstem 8144 Badge of Merit Moderation Voter Administrator Community Moderator
9 years ago

You have to put the code inside the event.

local plr = game.Players.LocalPlayer

plr.Character.functiondummy.Changed:connect(function()
    plr.Character.functiondummy.Value  = math.random(1, 99999999)
end)
0
I think the problem here is that you actually need to wait for the character to load before you can do anything with it. funyun 958 — 9y
0
Um, what? All that's doing is making it loop forever and use up cpu power. Im trying to use the Changed event to trigger a function just by changing it's value (therefore triggering it simply), but it doesen't respond. drew1017 330 — 9y
Ad

Answer this question