Why does one way of assigning a value to an objectValue work but the other doesn't?

Why does this work

local player = --the player
local playerObj = script.parent.objectValue 
playerObj.Value = player

but this doesn’t?

local player = --the player
local playerObj = script.parent.objectValue.Value 
playerObj = player

I mean I get that local something just points to it, but if it’s pointing to .value why can’t it be accessed

3 Likes

local playerObj = script.parent.objectValue points to the objectValue instance
image (this)

local playerObj = script.parent.objectValue.Value points to the value of the objectValue - not the property. So if the value was a player, it would point directly to the player
image (this)

4 Likes

by referencing PlayerObj in second snippet, u are getting the actual value. U have to assign the value from the property class

3 Likes

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.