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

[SOLVED] Changed function won't fire?

Asked by 6 years ago
Edited 6 years ago

game.Players.PlayerAdded:connect(function(player)

local stats = Instance.new("Folder", player)
stats.Name = "Stats"

local gemtag = Instance.new("IntValue", stats)
gemtag.Name = "Gems"
gemtag.Changed:connect(function()
    print "Hi"
end)

end)

when I change the gemtags value, the Changed function doesn't fire and it doesn't print Hi

0
2nd arguement of Instance.new & connect are deprecated. Use Connect & .Parent = X instead green271 635 — 6y
0
The event doesn't fire, not the function. User#19524 175 — 6y
0
Okay thanks but that still didn't fix the problem bojigglesmister2 2 — 6y
0
However you seem to be changing the value client sided. If the server listens for the event and the client changes the value; the server does not recognise the change. User#19524 175 — 6y
View all comments (4 more)
0
Okay then the event doesn't fire, my problem still remains bojigglesmister2 2 — 6y
1
incapaz thank you! You were right I messed up. bojigglesmister2 2 — 6y
0
If your problem was solved, mind updating your question title to contain "[SOLVED]"? It marks the question as answered and will let people know you are no longer in need of assistance. User#19524 175 — 6y
0
Yes bojigglesmister2 2 — 6y

Answer this question