This script works with fire and smoke, but not with this? Why? How do I fix it? Thanks for the help
local event = game.ReplicatedStorage.Remotes.deny local players = game:GetService("Players") local replicated = game.ReplicatedStorage local function deny(player) local wrong = Instance.new("ParticleEmitter") wrong.Texture = ("rbxassetid://5973806628") wrong.Rate = 1 local no = Instance.new("Sound") local yes = Instance.new("Sound") no.SoundId = ("rbxassetid://2781528288") yes.SoundId = ("rbxassetid://151573243") yes.Parent = wrong no.Parent = wrong wrong.Parent = player.Character.Head local a = 1 local b = 2 local number = math.random(1,2) if number == 1 then no:Play() else yes:Play() print("Fired Deny") wait(1.5) wrong:Destroy() end end event.OnServerEvent:Connect(deny)
Also if you have recommendations on how to make this code better let me know
Well, I think the problem is in line 18
if number == 1 then no:Play() else yes:Play() print("Fired Deny") wait(1.5) wrong:Destroy() end
You forgot to put wrong:Destroy() inside first if statement, I think?
Try using prints and see what line its broken into ex:
script.Parent:Destroy() print("it was the destroy part")
and try fixing the line that u figured out the error in!