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

ParticleEmmiter works in studio doesnt work in game?

Asked by 6 years ago
Edited 6 years ago

Here is the script it works in studio but doesnt work ingame

local tool = script.Parent
local player = game:GetService("Players").LocalPlayer
local debounce = false


tool.Equipped:connect(function(Mouse)
    print("Tool equipped!")
    Mouse.Button1Down:connect(function()
        if debounce then
        return nil
        else
        debounce = true     
        print("button pressed")
        local muzzle = workspace:WaitForChild("MuzzleEffect").Muzzle:Clone()
        local sound = workspace:WaitForChild("MuzzleEffect").Sound:Clone()
        muzzle.Parent = tool.Handle2
        muzzle.Enabled = true
        sound.Parent = tool
        sound:Play()
        game:GetService("Debris"):AddItem(muzzle,0.25)
        game:GetService("Debris"):AddItem(sound,0.7)
        end
        wait(1)
        debounce = false
    end)
end)

Answer this question