I've had the exact same problem, The reason is because you need to make it visible in the players gui
This is my script where if you touch the block the gui pops up
Local script
script.Parent.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
if plr then
if not plr.PlayerGui:FindFirstChild("GUIClonedfromtouchblock") then
local clonedgui = script.Parent:FindFirstChildOfClass("ScreenGui"):Clone()
clonedgui.Name = "GUIClonedfromtouchblock"
clonedgui.Parent = plr.PlayerGui
wait(0)
script.Parent.TouchEnded:Connect(function(hit2)
if hit == hit2 then
game.Debris:AddItem(clonedgui,0)
end
end)
end
end
end
end)
or do this it might not work
Use Server/normal script
local player = game.Players.LocalPlayer
script.Parnet.MouseButton1Click:Connect(function()
script.Parent.Parent:WaitForChild("InventoryFrame").Visible = true
player.PlayerGui:WaitForChild("InventoryFrame").Visible = true
end)
3 comments
Are there any errors?
lets see
there is