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

This script does work, but only once with no errors? I dont know what else to put in title

Asked by 4 years ago
local sp = script.Parent
local db = true
local Azarth = script.Parent["OpenShop"]

sp.Touched:connect(function(hit)
    if hit and hit.Parent:findFirstChild("Humanoid") and db then 
        db = false
        local player = game.Players:GetPlayerFromCharacter(hit.Parent)
        if not player.PlayerGui:findFirstChild("OpenShop") then 
            Azarth:Clone().Parent = player.PlayerGui
        end
        wait()
        db = true
    end
end)



thats the script, anyone see whats wrong? It doesnt show any errors, just only wokrs once?

Answer this question