I want it to like when the player selects the dialogChoice the value named "Owner" inside of the object to change to the players name when selected. hope this isn't to not understandable?
script.Parent.DialogChoiceSelected:connect(function(player, choice) if choice == script.Parent.Choice1 then local boat = game.Lighting.yo:clone() boat.Parent=player.Character boat:makeJoints() if boat.Parent.Owner.Value==nil then boat.Parent.Owner.Value=player.Character.Name return end end end)
From your description it seems that the "Owner" value is inside the boat, but right now you're trying to find it in player's character due to the boat.Parent.Owner
statement.
Also consider using line breaks and tabs. Yes, they aren't necessary and won't affect code functionality, but will make it a lot more readable for yourself and others.
script.Parent.DialogChoiceSelected:connect(function(player, choice) if choice == script.Parent.Choice1 then local boat = game.Lighting.yo:clone() -- Please don't use lighting as storage anymore, move it to ReplicatedStorage or ServerStorage boat.Parent=player.Character -- Note that boat will turn invisible in first person and will get destroyed once player dies. Consider placing it in workspace instead and rely on the Owner value? boat:MakeJoints() if boat.Owner.Value == "" then -- The string value exists by default, so it's not nil. Rather check for empty string boat.Owner.Value = player.Name -- No need to use character's name, using player's name would be more reliable return end end end)