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

How would I make sparkles start in a players torso when the player touches a block?

Asked by 9 years ago

I would like it to be where when a player touches a block, they get "Sparkles" coming out of their torso.

1 answer

Log in to vote
3
Answered by
MrFlimsy 345 Moderation Voter
9 years ago

Assuming you have a part named Button in Workspace, this should work:

game.Workspace.Button.Touched:connect(function(hit)
    if hit.Parent:FindFirstChild("Torso") then
        if not hit.Parent.Torso:FindFirstChild("Sparkles") then
            Instance.new("Sparkles", hit.Parent.Torso)
        end
    end
end)

Line 1: Connecting Touched event

Line 2: Checking if the Torso exists

Line 3: Checking if Sparkles already exist in the torso

Line 4: Adding sparkles

0
Thank you, that worked. You're awesome :3 SchonATL 15 — 9y
Ad

Answer this question