Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do i Allow the player to touch the part and claim it?

Asked by 4 years ago
Edited 4 years ago
local Door = script.Parent
local owned = false
Door.Touched:Connect(function(i)    
print(i.Parent) 
if not owned and i.Parent:FindFirstChild("Humanoid") then   
    Door.Transparency = 1       
    Door.CanCollide = false 
    Door.Parent.Name = i.Parent.Name.."'s Tycoon"
    end
end)
0
this doesnt really tell us anything, are there any errors when you run this script? guywithapoo 81 — 4y

1 answer

Log in to vote
0
Answered by
IDKBlox 349 Moderation Voter
4 years ago

you need to set the owned

local player = game.Players:GetPlayerFromCharacter(i.Parent)
if player then
    owned = player
end
Ad

Answer this question