#I need a little help here

1 messages · Page 1 of 1 (latest)

sick nest
#
local Effect = game.Lighting.ColorCorrection2
local rig = workspace.rig2
local head = rig:FindFirstChild("Head")
local scaryface = workspace:FindFirstChild("scaryface")
local music = workspace["Life in an Elevator"]
local scarymusic = workspace["Distorted scary trumpet"]

myPart.Touched:Connect(function(hit)
    local humanoid = hit.Parent:FindFirstChild("Humanoid")
    if humanoid and rig and head and scaryface then
        -- Remove the existing face decal from rig2.Head
        local oldFace = head:FindFirstChild("face")
        if oldFace then
            oldFace:Destroy()
        end
        -- Move scaryface decal to rig2.Head
        scaryface.Parent = head
        -- Apply the scary effect and sound
        Effect.Contrast = 1
        Effect.Brightness = -0.7
        music.Playing = false
        scarymusic.Playing = true
    end
end)```
How do i make it so the script works for like 5 secs and then stops? i tried script:Destroy() it doesnt do anything
tired cosmos
#

have you tried setting script.Enabled to false?