How is my returned value the same as the compared value, but not running?
Hi there! Very new to scripting. What am I doing wrong here? My output has not been "Owns the tycoon" and only returns multiples of "False." I've replaced "if player.OwnershipStatus.Owner.Value == false" with other qualifiers and those have all worked, but not this. Any help would be appreciated!
01 | local Players = game:GetService( "Players" ) |
03 | local part = script.Parent |
04 | local function onTouched(part) |
05 | local player = Players:GetPlayerFromCharacter(part.Parent) |
06 | if not player then return end |
08 | if player.OwnershipStatus.Owner.Value = = false then |
10 | script.Parent.Parent.Name = player.Name.. "'s Tycoon" |
11 | script.Parent.Parent.Parent.Owner.Value = player.Name |
12 | script.Parent.CanCollide = false |
13 | player.OwnershipStatus.Owner.Value = true |
14 | print (player.Name.. " Owns the Tycoon!" ) |
16 | print (player.OwnershipStatus.Owner.Value) |
20 | part.Touched:Connect(onTouched) |