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

[SOLVED]tool activation only makes frame visible once?

Asked by
danglt 185
4 years ago
Edited 4 years ago

When i activate the tool and any time it is suppose to make a frame visible, it doesn't work?

plr = script.Parent.Parent.Parent
char = plr.Character
hum = char.Humanoid
--------------------------------------
local enabled = true
local delaytime = plr:WaitForChild("delay")
local defaultdelay = 10
--------------------------------------
local storage = game.ServerStorage
local crates = storage.crates
local remotes = storage.remotes
--------------------------------------
script.Parent.Activated:Connect(function()
    if enabled == true then
        print("delay ok")
        if hum.FloorMaterial == Enum.Material.Plastic then
            print("plastic")
        enabled = false
        wait(defaultdelay)
        enabled = true
        else
            print("not plastic")
            plr.PlayerGui.DeployWarning.Frame.Visible = true
        end
    else
        print("delay not ok")
        plr.PlayerGui.DelayWarning.Frame.Visible = true
    end
end)

Answer this question