Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 5 years ago

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)

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 User#24403 69 — 5y
0
how should I start learning how to script? jeetthecool6 0 — 5y
0
The Wiki is the best teacher. DeceptiveCaster 3761 — 5y
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. cmgtotalyawesome 1418 — 5y
View all comments (3 more)
0
Especially when you're making the most simple type of game on roblox cmgtotalyawesome 1418 — 5y
0
I agree with cmgtotalyawesome, youu know what they say, code to learn, not learn to code. kevinliwu1 9 — 5y
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. LennyPlayzYT 269 — 5y

2 answers

Log in to vote
0
Answered by 5 years ago

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.

Ad
Log in to vote
0
Answered by
sasial 26
5 years ago
Edited 5 years ago

The parent of the Cloned Bilboard GUI should be:

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

Answer this question