I am making a game with someone and it's kinda an RPG and apoc thing. I want people to only be able to hold a single gun, how do I do that?
What you can do is you can check whenever the player's backpack's children have changed, then go from there!
The "ChildAdded" event is perfect for checking if something has been added.
game.Players.PlayerAdded:Connect(function(player) -- when the player joins the game. "player" is the player player:WaitForChild("BackPack").ChildAdded:Connect(function(object) --object being that new item added if object.Name ~= "put the name of your gun here" then --if not the gun, then... object:Destroy() --remove it! end end) end)
Please leave an upvote if this helped you out! Comment if something was wrong
Closed as Too Broad by zblox164, Gey4Jesus69, green271, and Void_Frost
This question has been closed because it is too broad and is generally unanswerable. Please ask a more specific question.
Why was this question closed?