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

MouseButton1Click function help?

Asked by
FiredDusk 1466 Moderation Voter
9 years ago

How do I make it add smoke to the player 1 TIME ONLY when they click?

1--//Variables
2local player = game.Players.LocalPlayer
3 
4--//Function
5script.Parent.MouseButton1Click:connect(function()
6    local sm = Instance.new("Smoke")
7    sm.Parent = player.Character.Torso
8 
9end)

1 answer

Log in to vote
5
Answered by 9 years ago

Just check if there is already smoke in their torso. Add

1if not player.Character.Torso:FindFirstChild('Smoke') then

before line 5 and add 'end' after line 7, but before the 'end)'

Ad

Answer this question