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

How would I make a script that tells a player their race via StarterGui?

Asked by 3 years ago
Edited 3 years ago

What the script is supposed to do is on the player clicks on the torso, it tells them their race, by making the text visible and changing it to telling them their race, but the problem is it doesn't produce any errors it just doesnt do anything when i click on the torso.

how would i go about fixing this error? (its a server script btw)

EDIT: on closer inspection, the script does change the text of the script and makes it visible, however it doesn't actually make it visible. (visible is checked but its not visible).

clickdetector = script.Parent
text = game.StarterGui.ScreenGui.currentrace
Players = game:GetService("Players")

Players.PlayerAdded:Connect(function(player)
    repeat
        wait()
    until
    player.Character
    chosenRace = player.Character:WaitForChild("CurrentRace").Value

    clickdetector.MouseClick:Connect(function()
        text.Text = "You are a " ..chosenRace
        text.Visible = true
    end)
end)
0
There's an issue there, you're attempting to modify the already existing gui inside of StarterGui AmokahTheFox 30 — 3y
0
yeah, i fixed it. i looked up a little bit more on startergui and turns out startergui is just a replicator, so i just changed it to playergui and it fixed it :P kegirosou 17 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

Fixed this error by changing startergui into playergui (as startergui is a replicator lol) oops

Ad

Answer this question