Before any thing!! Just to let you know I’m not best at speaking English!
-
What do you want to achieve? Keep it simple and clear!
I need to make script that when player is registered on Gui player name and problem shows up on surface gui. There should be max 4 registered players at time on part in workspace. And when player leaves gui of that player needs to be removed (I didn’t try to make this because I was trying to fix this bug) -
What is the issue? Include screenshots / videos if possible!
Issue is that when I make like second registration on gui (that should pop out on part in workspace) the first updates his information’s like that’s second gui.
This is screen shoot when I first register player:
This is screen shoot when I try to register next player:
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I tried looking around forum and YouTube videos but it didn’t help out.
This is code that should do all work:
local registeredPlayers = 0
RS.SurfaceGuiUpdate.OnServerEvent:Connect(function(player, userInfo, sender)
userInfo.userName = tostring(userInfo.userName)
userInfo.userProblem = tostring(userInfo.userProblem)
if registeredPlayers == 0 then
local newText = workspace.something.Screen.orginal:FindFirstChild("Patient"):Clone()
newText.Parent = workspace.something.Screen.orginal
newText.Name = userInfo.userName
newText.Text = userInfo.userName .. " - " ..userInfo.userProblem
newText.Position += UDim2.new(0,0,0.2,0)
newText.Visible = true
print("Player: " ..tostring(player).. ", made registration for: ".. tostring(userInfo.userName) .. " problem is: ".. tostring(userInfo.userProblem))
elseif registeredPlayers == 1 then
local newText = workspace.something.Screen.orginal:FindFirstChild("Patient"):Clone()
newText.Parent = workspace.something.Screen.orginal
newText.Name = userInfo.userName
newText.Text = userInfo.userName .. " - " ..userInfo.userProblem
newText.Position += UDim2.new(0,0,0.4,0)
newText.Visible = true
print("Player: " ..tostring(player).. ", made registration for: ".. tostring(userInfo.userName) .. " problem is: ".. tostring(userInfo.userProblem))
elseif registeredPlayers == 2 then
local newText = workspace.something.Screen.orginal:FindFirstChild("Patient"):Clone()
newText.Parent = workspace.something.Screen.orginal
newText.Name = userInfo.userName
newText.Text = userInfo.userName .. " - " ..userInfo.userProblem
newText.Position += UDim2.new(0,0,0.8,0)
newText.Visible = true
print("Player: " ..tostring(player).. ", made registration for: ".. tostring(userInfo.userName) .. " problem is: ".. tostring(userInfo.userProblem))
elseif registeredPlayers == 3 then
local newText = workspace.something.Screen.orginal:FindFirstChild("Patient"):Clone()
newText.Parent = workspace.something.Screen.orginal
newText.Name = userInfo.userName
newText.Text = userInfo.userName .. " - " ..userInfo.userProblem
newText.Position += UDim2.new(0,0,0.12,0)
newText.Visible = true
print("Player: " ..tostring(player).. ", made registration for: ".. tostring(userInfo.userName) .. " problem is: ".. tostring(userInfo.userProblem))
elseif registeredPlayers == 4 then
end
end)


Thank you