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

Ways to convert a player value into an object value?

plr = game.Players.LocalPlayer
player = workspace:WaitForChild(plr)

In the above the output says it cant find player. Is there a way to convert the player value in plr into an object value in player.

2 comments

3

A Player Value is already a object value. If you're trying to get the character, why the heck don't you just use plr.Character?

0

the problem is you are missing a big piece "Character", plr = game.Players.LocalPlayer.Character

1 answer

I'm not entirely sure what you're asking but I can explain why your code doesn't work.

Your code doesn't function because 'plr' is the actual Player object. The WaitForChild function takes in strings, not objects. You probably got an error like:

Infinite yield possible on 'workspace:WaitForChild("Instance")'

If the WaitForChild function causes the script to yield for 5 seconds, it will return this error.

1 comment

0

I already understand that

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