Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

This script won't change the overhead gui as the player reaches the next level, help?

Hey, I'm a new scripter, I just started like 2 days ago. Im making a basic starting obby game. I made this script for a overhead GUI with the help of Alvinblox plus some minor additions of my own. I want it where the overhead GUI changes the text when the player reaches the next level (team) the following script does work however it does not change the overhead GUI as the player changes team but after they die and respawn. Im trying to make it where the overhead gui changes as the player reaches the new level even if they do not die.

Script: local billboardgui = game:GetService("ServerStorage"):WaitForChild("BillboardGui")

game.Players.PlayerAdded:Connect(function(player)

player.CharacterAdded:Connect(function(character)

\-- Stage 1 starts	

	if player.Team == game.Teams.Start then

		local clonedgui = billboardgui:Clone()

		clonedgui.TextLabel.Text = "Start"

		clonedgui.TextLabel.TextColor3 = Color3.fromRGB(61,232,14)

		clonedgui.Parent = game.Workspace:WaitForChild(player.Name).Head

	end

\-- Stage 1 ends

\--- Stage 2 starts

if player.Team == game.Teams\["Stage 2"\] then

		local clonedgui = billboardgui:Clone()

		clonedgui.TextLabel.Text = "Stage 2"

		clonedgui.TextLabel.TextColor3 = Color3.fromRGB(0,16,176)

		clonedgui.Parent = game.Workspace:WaitForChild(player.Name).Head

	end

\-- Stage 2 ends

end)

end)

7 comments

0

Why is there random backslashes in your code? Also don't watch alvinbloxx, if you actually started scripting 2 days ago, you shouldn't be making a game so early. Take the time to learn. Don't rush yourself. Alvinbloxx's tutorials are way too specific and he is not a good beginner's source. He also teaches bad coding practices, this code you are showing us is inconsistent and just plain bad. He als

0

how should I start learning how to script?

0

The Wiki is the best teacher.

0

I don't actually agree with incapaxx completely. I think that the best way to learn scripting is to start making a game with what you know, and when you run into an error you ask this website. It should be a balance between the two. Only using incapaxx's suggestion would be like reading the spanish dictionary and never speaking the language. Only scripting is speaking without vocabulary.

0

Especially when you're making the most simple type of game on roblox

0

I agree with cmgtotalyawesome, youu know what they say, code to learn, not learn to code.

0

Hey @jeetthecool6, I would be happy to help you fix your problem if you friend me, share your game. I would be happy to fix your game. Tell me if you will accept my offer.

2 answers

It only changes when the player dies because you're only telling it to run when the player's character is added. Make the function activate whenever the player's team switches.

The parent of the Cloned Bilboard GUI should be:

clonedgui.Parent= game.Players:FindFirstChild(player.name):FindFirstChild("PlayerGui")

This discussion is preserved as it was. New answers, comments, and votes are closed.