Hi again! So I am kind of new to scripting but have been a builder for a while. I am trying to make an onTouch event so when the player steps on the part, particles come out of the part and then they stop a second later. I was hoping someone on the DevForum could help me out!
local GetBlocks = --part that player must stand on
local function steppedOn(part)
local parent = part.Parent
local Player = game.Players:GetPlayerFromCharacter(parent)
if Player then
--put stuff when player goes on brick here
end
end
GetBlocks.Touched:Connect(steppedOn)
The particle emitter has a function called emit() that can be called on it when the particle emitter is disabled. Perhaps this would work:
local Brick -- Set this variable to the part you want the player to stand on.
local Emitter -- Set this to the particle emitter.
Brick.Touched:Connect(function(Part)
if not part.Parent:FindFirstChild("Humanoid") then -- This is to make sure whatever touched it is a character.
Emitter:emit(50) -- Set the number in the parenthesis to the number of particles you want it to emit.
end
end)