Frame visibility doesn't change on client

script.Parent.TouchEnded:Connect(function(hit)
local player = game:GetService(“Players”):GetPlayerFromCharacter(hit.Parent)
if player then
IndexFrame.Visible = false
NormalCrate.Visible = false
end
end)

The index frame becomes invisible, however, the normal crate frame remains visible. The property only changes on the server.

Where are the paths for the Frames? Make sure you index the frames paths from the player’s PlayerGui instead of StarterGui first after you get the player, then make them invisible.

1 Like

I’m sure they’re being changed from inside PlayerGui

Can you show how did you refer to IndexFrame and NormalCrate? And this is not a LocalScript right?

Also can you try print(player) after this segment? Make sure it’s not printing nil

and print(IndexFrame.Visible, NormalCrate.Visible) after this segment, see if they print false or not.

I already did, and yes, this is not a localscript.

script.Parent.TouchEnded:Connect(function(hit)
local player = game:GetService(“Players”):GetPlayerFromCharacter(hit.Parent)
if player then
player.PlayerGui.Crates.NormalCrate.Visible = false
player.PlayerGui.Crates.IndexFrame.Visible = false
print("Visible: ", player.PlayerGui.summonUnits.NormalCrate.Visible)
end
end)

but it is still visible.

image
image

I just used remoteEvents to ensure they’d all be open

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.