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

How do i make the keys only work one time to pick?

Asked by 4 years ago

Hi. I have made a brick with 15 keys on it ( each key is for each house ) but i dont know how to make the players only take 1 key. You see, They can take all 15 keys if They want to and i would be really greatful if you could help me to make them only take one key and then not be allowed to take another key. Thank you!

0
Post your script please Leamir 3138 — 4y

1 answer

Log in to vote
0
Answered by 4 years ago
Edited 4 years ago

You can make with Touched.

exemple:

local part = script.Parent

part .Touched:Connect(function(hit) -- hit is when an object touches the part
    if hit then -- Verify if something touches
        local player = game.Players:GetPlayerFromCharacter(hit.Parent) -- get the player
        if player.Character.Humanoid then -- if the player has a Humanoid
            part:Destroy() -- Here Destroys the part
        end
    end
end)

But i still need a screen shot of the items.

0
How do i paste in a screenshot? DogPower05 0 — 4y
0
You can paste it here , or edit the post and add a link DragosGames 43 — 4y
0
I dont really know What you mean with parent? Is it the part? DogPower05 0 — 4y
0
Just give me a screen shot with the items DragosGames 43 — 4y
Ad

Answer this question