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

Why does my part fade away before I even get to touch it?[SOLVED]

Asked by 3 years ago
Edited 3 years ago
local debounce = true
script.Parent.Touched:Connect(function(hit)
    print("Touched")
    if hit.Parent:FindFirstChild("Humanoid") then
        if debounce then
            debounce = false
        while script.Parent.Transparency <= 1 do 
            script.Parent.Transparency = script.Parent.Transparency + 0.004
            wait(0.01)
        end
        script.Parent.CanCollide = false
        wait(3)
        script.Parent.CanCollide = true
        script.Parent.Transparency = 0
        debounce = true
        end
    end
end)

It checks if the object hitting it is a humanoid, so why is it still activating? Same goes with my kill brick, it keeps printing.

1 answer

Log in to vote
0
Answered by 3 years ago
Edited 3 years ago

I don't know what you are talking about. The script works perfectly fine. I put the script into a normal part. When I touched it, it worked fine. The script acted like it was supposed to do.

0
The thing is: He added NPCs to the game, and I told him to add Players:GetPlayerFromCharacter(). Dovydas1118 1495 — 3y
0
Oh ok. peter21340 41 — 3y
Ad

Answer this question