This codes opens when someone else steps on the object, please explain to me how to fix it Code:
game.Workspace.ShopPart.Touched:Connect(function(hit)
if hit then
script.Parent.Shop.PetInventory.Visible = true
end
end)
This codes opens when someone else steps on the object, please explain to me how to fix it Code:
game.Workspace.ShopPart.Touched:Connect(function(hit)
if hit then
script.Parent.Shop.PetInventory.Visible = true
end
end)
-- Script in ServerScriptService
local guiname="ScreenGui" -- change
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)
So basically its just getting when its touched and if hit then is just soemthing to check
im bad at coding, please explain more if you can
it just makes a gui visible when somehhing touches it
This discussion is preserved as it was. New answers, comments, and votes are closed.
1 comment
Thanks!