I'm trying to make it so that whenever touch pad is touched, the script finds the players name and assigns it to the Owner StringValue and then prints the owners name. So far it prints the owners name, however the Owner StringValue remains unchanged. What am I doing wrong?
local touchpad = Tycoon.Entrance.touchpad local owner = game.Workspace.Tycoon.Owner.Value local function steppedOn(part) local player = part.Parent if game.Players:GetPlayerFromCharacter(player) then local player = game.Players:GetPlayerFromCharacter(player) owner = player -- Supposed to make the Owner.Value equal to the player print(owner) end end touchpad.Touched:connect(steppedOn)
Thanks
owner
to the value of the Owner
object at the time of assignment. Assuming it’s an ObjectValue
and the Value
is nil
, line 2 would be the same as:local owner = nil
.Value
.local owner = game.Workspace.Tycoon.Owner
owner.Value = player