I made a part that shows a gui to the player when its clicked, it only work once for no reason, I tried putting a print in the code and it did print it, this got me all confused, heres my script
script.Parent.MouseClick:Connect(function(plr)
if not plr:WaitForChild("Inventory"):FindFirstChild("Wallet") then --the model is not in place
print("lol")
plr:WaitForChild("PlayerGui").inGame.Swiper.Visible = true
elseif plr:WaitForChild("Inventory"):FindFirstChild("Wallet") then --the model is in place and it enables the gui that needed so it will function
print("LOL")
plr:WaitForChild("PlayerGui").inGame.Swiper.Visible = true
plr:WaitForChild("PlayerGui").inGame.Swiper.Card.Visible = true
plr:WaitForChild("PlayerGui").inGame.Swiper.Arrow.Visible = true
end
end)
script.Parent.MouseClick:Connect(function(Player) -- dude clicks
if not Player:WaitForChild("Inventory"):FindFirstChild("Wallet") then -- Player guy has no wallet
print("lol") -- no wallet
else
print("LOL") -- has wallet
end
end)
script.Parent.MouseClick:Connect(function(Player)
if Player:FindFirstChild("Inventory") and Player.Folder:FindFirstChild("Wallet") then
Player:WaitForChild("PlayerGui").inGame.Swiper.Visible = true
Player:WaitForChild("PlayerGui").inGame.Swiper.Card.Visible = true
Player:WaitForChild("PlayerGui").inGame.Swiper.Arrow.Visible = true
else
warn("no.")
end
end)