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
8 years ago

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

--//Variables
local player = game.Players.LocalPlayer

--//Function
script.Parent.MouseButton1Click:connect(function()
    local sm = Instance.new("Smoke")
    sm.Parent = player.Character.Torso

end)

1 answer

Log in to vote
5
Answered by 8 years ago

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

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

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

Ad

Answer this question