Hi devs! I currently making a game where it shows players list on a part. But I ran into this problem. Could you guys tell me what is the problem with the script?
-
What do you want to achieve? Keep it simple and clear!
I want to know that whats the issue of the script -
What is the issue? Include screenshots / videos if possible!
Players list not working on surface GUIs -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I looked for it in the dev hub but it didnt help me much
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
Code for surfacegui:
function temp(plrname)
local clone = script.Parent.ScrollingFrame.Playername:Clone()
clone.Text = plrname
clone.Name = plrname
clone.Parent = script.Parent.ScrollingFrame
clone.Visible = true
end
game.ReplicatedStorage.AddPlayer.OnClientEvent:Connect(function(plrname)
temp(plrname)
end)
Code for serverscriptservice:
game.Players.PlayerAdded:Connect(function(plr)
game.ReplicatedStorage.AddPlayer:FireAllClients(plr.Name)
game.ReplicatedStorage.CurrentPlayers.Value += 1
end)
game.Players.PlayerRemoving:Connect(function(plr)
game.ReplicatedStorage.RemovePlayer:FireAllClients(plr.Name)
game.ReplicatedStorage.CurrentPlayers.Value -= 1
end)
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.
