Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

lol123 is not a valid member of PlayerGui?

I have been trying to fix this for a few days, but it's no use. No matter how much I try, it won't fix. Here is my code:

script.Parent.Touched:Connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid") then
		player = game.Players:GetPlayerFromCharacter(hit.Parent)
		player.GettingCash.Value = true
		if player.GettingCash.Value == true then
			player.PlayerGui.lol123.Frame.Visible = true
		end
	end
end)

I checked in Studio and whenever I play the game in Studio, it has lol123 (ScreenGui) and works in studio. However in game, it won't work.

1 answer

✓ Accepted answer

Assuming this script is a basic script and not local - which it should be if it isn't - scripts do not see anything stored in the player. Really all they see is the names PlayerGui, Backpack, and that's about it. They see nothing else, whether it's stored in the player itself or in the folders you assign these values to. I actually discovered this myself when doing this myself, which was a devastating discovery as I set a decent amount of framework that relied on the server seeing local values.

Anywhos, I would suggest having a RemoteEvent set up and have a local script act on this event. It's pretty basic and follows what you're doing and if you don't know how to use a RemoteEvent, go to this link.

Hope this helps!

1 comment

1

Thank you! :D

This discussion is preserved as it was. New answers, comments, and votes are closed.