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

How would i make my character do a function when he touches a brick?

Asked by 7 years ago

I know how to make bricks react whenever they touch another humanoid, but I want a brick to respond whenever a humanoid touches it, if that makes sense. Whenever a player respawns, they have a brick that is glued to the back of them and whenever the character touches the brick, I want something to print. If I make it whenever the brick touches the character, some words pop up in the player's gui and if a player presses a button while touching the brick, an action happens. If i put the script on the brick however, the script wouldn't work. Please help, I have some code of what I WANT t o happen, although this says, "Touched is not a valid member of player"

game.Players.PlayerAdded:connect(function(player)
    player.CharacterAdded:connect(function(character)
    player.Touched:connect(function(hit)
        local block = hit.Parent:findFirstChild("Assassin Block")
        if block then
            -- Code
end)
end)
1
Use character.PARTYOUWANTTHETOUCHEDEVENTTOWORKON.Touched Of course change that ridiculously long word to Torso or Head or something. M39a9am3R 3210 — 7y
0
Touched event. GoldenPhysics 474 — 7y

Answer this question