Welcome. If you can help me solve this problem, you will be granted as a long time friend. I've gone bald over this script.
Basically, if you've ever seen "Mazerunner" the movie, you'll know what my game is about. "BlockRunner" is a spin-off from the movie in which players act out a life of confinement, foraging, monster killing, and survival.
So far, I've created a center safe haven and a partial maze. Some ranks are also available (8 of them). Some basic scripts and Gui's also work. For example:
- When a player joins, the player is welcomed to the server by a Gui that is seen by everyone.
- When a player ranks up, the player is celebrated in front of the entire server.
- When players leave a game, their rank is saved.
I first thought everything was working fine. Until I joined the server with some friends and realized you cannot see the Gui when other players rank up or join the server. You could see your own celebrating and server join Gui, but others cannot. I also realized that the save script didn't work. And I also realized you could rank up every time you died.
So whilst I was bummed, I began fixing the bugs. I fixed the save script and the rank up when a player dies. However, I cannot fix the Gui problem. For the life of me. I cannot fix it. So I had one of my friends who's a little more knowledgeable in Lua help me out. After around 4 hours, he left and the script remained broken.
I have a Trello with screenshots of the bugs, and I also have team create enabled if you would like to help me internally. Otherwise, I'm going to try my best to show you the scripts here.
This is my base script. It controls the Gui's and the sounds.
local Leaderboard = game.Players.LocalPlayer:WaitForChild("leaderstats")
local Door = game.Workspace.Doors:WaitForChild("Door")
local plr = game.Players.LocalPlayer
repeat wait() until plr.Character
wait()
function celebrate()
for num,player in ipairs(game.Players:GetPlayers()) do
local CelebGui = plr.PlayerGui.Celebrate
CelebGui.Frame.Visible = true
if Leaderboard.RankVal.Value == 1 then CelebGui.Frame.TextBox.Text = ""..player.Name.." has joined the server!"
CelebGui.Frame.ImageLabel.Image = "http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&Format=Png&username="..player.Name..""
game.Workspace.NewPlayer:play()
else
CelebGui.Frame.TextBox.Text = ""..player.Name.." has ranked up to "..Leaderboard.Rank.Value.."!"
CelebGui.Frame.ImageLabel.Image = "http://www.roblox.com/Thumbs/Avatar.ashx?x=100&y=100&Format=Png&username="..player.Name..""
game.Workspace.Celebrate:play()
end
wait(3)
CelebGui.Frame.Visible = false
end
end
function DoorOC()
for num,player in ipairs(game.Players:GetPlayers()) do
local DoorGui = plr.PlayerGui.Doors
DoorGui.Frame.Visible = true
if Door.Value == 0 then
DoorGui.Frame.TextBox.Text = "The door has closed."
game.Workspace.Door:play()
else
DoorGui.Frame.TextBox.Text = "The door has opened."
game.Workspace.Door:play()
end
wait(3)
DoorGui.Frame.Visible = false
end
end
Leaderboard.RankVal.Changed:connect(function(value)
if value == 1 then Leaderboard.Rank.Value = "Newbie" elseif
value == 2 then Leaderboard.Rank.Value = "Member" elseif
value == 3 then Leaderboard.Rank.Value = "Forager" elseif
value == 4 then Leaderboard.Rank.Value = "Watcher" elseif
value == 5 then Leaderboard.Rank.Value = "Mason" elseif
value == 6 then Leaderboard.Rank.Value = "Warrior" elseif
value == 7 then Leaderboard.Rank.Value = "Runner" elseif
value == 8 then Leaderboard.Rank.Value = "Elder"
end
end)
script.Parent.NPEvent.OnClientEvent:connect(function(player)
celebrate()
end)
Door.Changed:connect(function(value)
wait(1)
DoorOC()
end)
wait()
Leaderboard.RankVal.Value = 1 -- This was adding everytime the player died I jsut changed it to = 1 instead of + 1
This is the leaderboard script. Ignore the word tycoon, as it is partially from my other game.
print("Leaderboard is running.")
function onPlayerEntered(newPlayer)
repeat wait() until newPlayer.Character
for i, v in pairs(game.Players:GetChildren()) do
v.PlayerGui.NPEvent.FireClient(v, newPlayer)
end
local stats = Instance.new("Folder")
stats.Name = "leaderstats"
local cash = Instance.new("StringValue")
cash.Name = "Rank"
cash.Value = 0
local val = Instance.new("IntValue")
val.Name = "RankVal"
val.Value = 0
--check if the player owns your gamepass
if game:GetService("MarketplaceService"):PlayerOwnsAsset(newPlayer, 384198804) then
cash.Value = 0 -- change cash to 500,000 (can't have a comma)
else
cash.Value = 0
end
cash.Parent = stats
stats.Parent = newPlayer
val.Parent = stats
end
game.Players.ChildAdded:connect(onPlayerEntered)
This is a picture of the Gui system and main parts of the game in explorer. http://imgur.com/7LvAzFB
Again, any help is *GREATLY *appreciated.
Thanks, Tradesmark

2 comments
Use a remote event to tell the server who has ranked up, and from there use a remote event to fire all clients with the player's name that ranked up and on each client, show the appropriate GUI.
That is what I attempted to do. But now the Gui's do not show at all.