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

does object value hold a name? or an actual object

Asked by 6 years ago
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?

0
It would return nil... Because you are trying to find the character in Players service. arshad145 392 — 6y
0
so, you are saying objectvalue holds the actual model and not the string of the name? correct? PoePoeCannon 519 — 6y
0
Yes, refer here for more information : http://wiki.roblox.com/index.php?title=API:Class/ObjectValue arshad145 392 — 6y

1 answer

Log in to vote
1
Answered by
arshad145 392 Moderation Voter
6 years ago
Edited 6 years ago

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.

0
thanks alot arshad, this helped tremendously! I have accepted your answer and i would upvote if i had enough points! PoePoeCannon 519 — 6y
0
You're welcome ^^ arshad145 392 — 6y
Ad

Answer this question