![]() That's why we create megathreads to help keep everything organized and tidy. When Roblox events come around, the threads about it tend to get out of hand. Our current header image is from this game here! If you cloned the tool into the player's Backpack previously, you can do Backpack.:Destroy() to get rid of it/make it dissapear.Roblox is a game creation platform/game engine that allows users to design their own games and play a wide variety of different types of games created by other users. Now we can do the same thing that we did to check for a humanoid, to check for our tool. Local player = game.Players:GetPlayerFromCharacter(hit.Parent)Īs you may know, Backpack is a direct child of the player in game.Players, so we can use player.Backpack to find our Backpack. Added to your code, here is what it should now look like. Either one work, but I will be using the first one for this example. This is similar to game.Players:FindFirstChild(.Name). A Character is just your player in game.workspace, so by calling this function, it gets your player in game.Players from your character. Now that we have verified that a player was what touched our part, we can use the function of game.Players called GetPlayerFromCharacter(). ![]() If hit.Parent:FindFirstChild("Humanoid") then You can do this by looking for a Humanoid, which would be a sibling of the part that touched. Since any object can touch the part, but not every one has a Backpack, you'll want to first check if the object that hit your part is from an actual player. Print(hit.Name) -As per the example above, this would print "Left Foot" For example, if a player (R15) stepped on a block on the floor, the object that hit the part might be Left Foot. Touched event can carry one parameter the object that touched it. Touched event which fires every time an object is touched.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |