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

does object value hold a name? or an actual object

local creator = Instance.new('ObjectValue', p.Parent.Enemy)
creator.Name = "creator"
creator.Value = script.Parent.Parent
wait(4)
creator:Destroy()
				

when i make the value of that objectvalue = script.Parent.Parent ---- (which is my character model)

does it just take the name of my character model? or is it my actual character model id. like, if i put

game.Players:FindFirstChild(creator.Value) 

would it return my character model or my player?

3 comments

0

It would return nil... Because you are trying to find the character in Players service.

0

so, you are saying objectvalue holds the actual model and not the string of the name? correct?

0

Yes, refer here for more information : http://wiki.roblox.com/index.php?title=API:Class/ObjectValue

1 answer

✓ Accepted answer

But you can do this...to find the player from the creator.Value

local player = game.Players:GetPlayerFromCharacter(creator.Value)

That will only work if the creator.Value is a character.

2 comments

0

thanks alot arshad, this helped tremendously! I have accepted your answer and i would upvote if i had enough points!

0

You're welcome ^^

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