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

How do i give my tycoon door an owner or make it only unique to a player ?

Asked by 5 years ago

Exactly as the title says. How exactly would i give my tycoon door an ontouch thing (Nub to scripting)

0
Used the Touched event from a BrickPart and some simple if-checks. Make an attempt for further help. xPolarium 1388 — 5y
0
You have to explain more do you want the player to have the door when the player starts or when the player clicks. You could also want a key or they are in when they click a button so I dont know how to make it.  turquoise_monkeyman 32 — 5y

1 answer

Log in to vote
0
Answered by
starmaq 1290 Moderation Voter
5 years ago

You would want to use the .Touced event and check if the part that touched the door is the player that owns the place. I'm assuming you have no knowledge with scripting, so please if you don't learn first.

door.Touched:Connect(function(hit) --that hit will be the object that touched the door
    if hit.Parent == "starmaq" then -- this will check if the hit's parent is the player you want, we check if the parent is the player not the hit because the hit is a bodypart of the player, and bodyparts are parented to the player, that's why we check the parent
       --and put the code you want here
    end
end)
0
.Touched* Fad99 286 — 5y
Ad

Answer this question