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

Is there a way to fix this call to StarterPlayer?

Hello all, I've been trying to create a type or morph button via GUI that connects to the "StarterPlayer". I've debating on how to actually go about creating this morph button, and figured that by adding a Character Model to the StarterPlayer, and having a GUI that changes the name of said character to "Startercharacter" for said local player, that it'd create a type or morph without to advanced of coding.

Here is what I have so far, It says that StarterPlayer isn't a vlid member of Player, so I don't understand why that is, or what. Any and all help is appreciated!

Keep in mind, this is in a LOCALSCRIPT

local player = script.Parent.Parent.Parent
local boy = script.Parent.Parent.Parent.Parent.StarterPlayer.StarterBoy

script.Parent.MouseButton1Click:Connect(function(click)
	if click then 
		boy.Name = "StarterCharacter"
	end
end)

1 answer

I would use this instead:

local boy = game:GetService("StarterPlayer"):WaitForChild("BoyModelName")

3 comments

0

Attempted this, it didn't work!

0

Did u replace "BoyModelName" with "StarterBoy" (because I just gave my example), this is correct way to get StarterPlayer. I just tested it and it works.

0

Bryan I focused more on your code that question you asked, now I saw that you changed name from local script. You must use remotevents to change name of that model in order for player to get that character. https://developer.roblox.com/en-us/articles/Remote-Functions-and-Events

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