This script is supposed to open a GUI for a shop, but It doesn't work. Also the script is supposed to open up a different shop dependent on what device you're on. So a phone will open shop 2 while a PC opens shop1.
script.Parent.Touched:connect(function(part)
local plr = game.Players:GetPlayerFromCharacter(part.Parent)
if game:GetService("UserInputService").TouchEnabled == true then
if plr then
if plr.PlayerGui.Shop2.Enabled == false then
plr.PlayerGui.Shop2.Enabled = true
print("Shop Opened")
else
if plr then
if plr.PlayerGui.Shop1.Enabled == false then
plr.PlayerGui.Shop1.Enabled = true
print("Shop Opened")
end
end
end
end
end
end)

1 comment
Thanks a lot. Also I appreciate you actually telling me why it's not working for next time.