Hey!
I'm trying to make a buyable house but for some reason this if statement doesn't work. Help?
The Owner value is set to my name so the script should change the door's properties
Script:
owner = script.Parent.Parent.Owner
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
if hit.Parent.Name == owner then
script.Parent.Transparency = 0.5
script.Parent.CanCollide = false
end
end
end)

2 comments
But your script caches the first value of Owner for ever. You should rather get its value each time.
I added .Value to the owner variable and it didn't work but I did what Kiriot said and added .Value to the if statement that is comparing the 2 strings and it worked so Thank You both :D