I'm working on a game and the start has a party GUI a little bit like dungeon quest's, just lower quality.
local temp = script.Parent
local event = game.ReplicatedStorage.updateListC
local serverAmount
local scrip = script.joinButtonScript
event.OnClientEvent:Connect(function(name, priv, diff, pass)
if temp.Name == "template" then
local server = temp:Clone()
local scrip2 = scrip:Clone()
if serverAmount == nil then
serverAmount = 1
else
serverAmount = serverAmount + 1
server.Position = temp.Position + UDim2.fromScale(0, 0.031)
end
server.Parent = temp.Parent
server.Visible = true
server.Name = "server"..tostring(serverAmount)
server.name.Text = name
server.joinability.Text = priv
server.difficulty.Text = diff
scrip2.Parent = server.join
print("server made")
else
print("error in template script")
end
end)
This is fired on all clients from the server. It's parent is a template for what the servers would look like on a list of all of them, and it has a LocalScript under it that is supposed to activate when they press the join button. ("server made" is printed)
while wait() do
if script.Parent.Parent.Name == "partyList" then
break
end
end
print("out of loop")
local join = script.Parent
local player = game.Players.LocalPlayer
local event = game.ReplicatedStorage.joinPartyE
local func = game.ReplicatedStorage.joinPartyR
local partyMenu = join.Parent.Parent.Parent.partyMenu
join.MouseButton1Click:Connect(function()
local serverToJoin = join.Parent.name.Text
event:FireServer(serverToJoin)
end)
event.OnClientEvent:Connect(function(data)
if data[1] == true then
partyMenu.LocalScript.Enabled = false
partyMenu.start.Visible = false
join.Parent.Parent.Visible = false
partyMenu.player1.Text = data[2]
if data[3] then
partyMenu.player2.Text = data[3]
else
partyMenu.player2.Text = player.DisplayName
end
if data[4] then
partyMenu.player3.Text = data[4]
partyMenu.player4.Text = player.DisplayName
end
partyMenu.Visible = true
else
partyMenu.Parent.full.Visible = true
end
end)
This is the join button script, which never prints "out of loop" because the first script never actually makes a server gui. While it is visible to other players, I can never find it in the explorer, which makes this script fail because it is not under "partyList." Can anyone figure out where the error is in the first script?
