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

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

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)

2 comments

0

There's an issue there, you're attempting to modify the already existing gui inside of StarterGui

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

1 answer

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

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