Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

the script below works when you join the game, but after reset it does not work. any help?

local sp = script.Parent
local db = true
local Azarth = script.Parent.FinalFlash
local Body = script.Parent.Parent.Parent.Suit
local FlashArm = Body.Arm1.Middle.FinalArmCharge
local FlashChest = Body.Chest.Middle.FinalCharge

sp.Touched:connect(function(hit)
    if hit and hit.Parent:findFirstChild("Humanoid") and db then 
local Foreign = hit.Parent
        db = false
        local player = game.Players:GetPlayerFromCharacter(hit.Parent)
        if not player.PlayerGui:findFirstChild("FinalFlash") then 
            FlashArm:Clone().Parent = Foreign.Arm1.Middle
            FlashArm:Clone().Parent = Foreign.Arm2.Middle
            FlashChest:Clone().Parent = Foreign.Chest.Middle
            Azarth:Clone().Parent = player.PlayerGui.Option.Frame
        end
        wait()
        db = true
    end
end)

the azarth clone doesnt work (its a gui) after you die or reset, anyone know why & can solve this?

2 comments

0

It’s FindFirstChild, not findFirstChild

0

no difference

1 answer

The Azarth clone is never removed from the GUI since the player GUI stays the same even after a player character dies thus the function will find "FinalFlash" as true. You should remove azarth(or final flash) when a player dies.

2 comments

0

does not work

0

how would i accomplish this

This discussion is preserved as it was. New answers, comments, and votes are closed.