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

This code opens the shop when someone else steps on it.. please explain to me how to fix this??

Asked by 3 years ago

this code opens the shop when someone touches the shop, please help me fix this Code:

local guiname="Shop"
local Players=game:GetService"Players"
local function showgui(player,guiname)
    player.PlayerGui[guiname].Shop.PetInventory.Visible=true
end
local a;workspace.ShopPart.Touched:Connect(function(part)
    if a then return end;a=true
    local player=Players:GetPlayerFromCharacter(part.Parent)
    if player then
        pcall(showgui,player,guiname)
    end
    wait(1)a=false
end)

Answer this question