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

Why does only 1 player have their credits showing???[SOLVED]

Asked by 7 years ago
Edited 7 years ago
function join(hit)
while true do wait()
local credits=script.Parent
PlayerCredits=hit.Credits.Value
credits.Text="Credits:"..PlayerCredits
end
end
game.Players.PlayerAdded:connect(join)

Basically, this script will only show the credits for one player. If there are 2 players, only one of the players has their Credits showing on their GUI.

0
more details please? what is written makes it look like its working normally loulou1112 35 — 7y
0
When I test this in server mode with 2 players only 1 players has their credits showing, so say one player has 20 credits and the other also has 20 credits, only one of those players have their credits showing on the GUI Ex_plore 62 — 7y
0
Is this in a local script? Troidit 253 — 7y
0
Line 2 "while true do wait()", why do you ever expect it to leave that loop? GoldenPhysics 474 — 7y

2 answers

Log in to vote
0
Answered by
waifuSZN 123
7 years ago

Try adding local player to the script.

Ad
Log in to vote
0
Answered by 7 years ago
game.Players.ChildAdded:connect(function(hit)
while true do wait()
local credits=script.Parent
local PlayerCredits=hit.Credits.Value
credits.Text="Credits:"..PlayerCredits
end
end)

This is a guess, not sure where the script is supposed to go.

0
This would have the same outcome as PlayerAdded and ChildAdded are essentially the same thing, eitherway I solved my problem. Ex_plore 62 — 7y

Answer this question