Open Gui Not Working

Just so you know sending a remote event to the server is in no way necessary, this code should be handled via the client for well its just better that way performance wise and for the sake of not doing things unnecessary

I was thinking the server will handle when the part is touched, then send a remote event to the client which will set the GUI visible to true

1 Like

Yeah that would work but its best to just handle it via the client

2 Likes

Okay, you likely know better than i do. Ive personally never handled a part touch like that through the client, but if it works it works

2 Likes

its ok, we’ve all been there (I probably would have made it that way in the past gonna be real with you!)
I just like spreading the good word so no one has to make these mistakes and just make their code better! : D

1 Like

Definitely! Its always good to learn new and better ways to make your code

2 Likes

I still have a problem, nothing works and I don’t have any errors to guide me to know where I went wrong, the documentation also doesn’t give me any clues to the gui, only separately and I know it works a little differently :cry:

can you show us your code?
Thanks!

1 Like
local AbilityList = game.Players.LocalPlayer.PlayerGui.WaitForChild("GuiAbilities")
local TouchPart = workspace.Obby.SelectAbilityRing.Part


TouchPart.Touched:Connect(function(part)
	if (part.Parent:FindFirstChildWhichIsA("Humanoid")) then
		local player = game.Players.GetPlayerFromCharacter(part.Parent)
		AbilityList.Enabled = true
		print("Work")
	end
end)
1 Like

So I see a problem with your code, and its ok its a common mistake, basically you are doing this:

.WaitForChild("GuiAbilities")

Now WaitForChild() isnt a property so we need to use a different symbol, instead of a ., we need to use this :.
Try this:

local AbilityList = game.Players.LocalPlayer.PlayerGui:WaitForChild("GuiAbilities")

1 Like

Would be helpful to know so we can help you out better.

1 Like

it’s the first time I make this mistake, lol, but it still doesn’t work, the local script is placed in part, I hope that this information can somehow affect my script
@Herbz_Dev2106 Herbz_Dev2106 sorry for not answering you, I was focused on seeing where I am wrong

2 Likes

Yeah I am just curious, since I’ve never accessed PlayerGui directly before. So the object is where before the game starts?

1 Like

Ok so first, take the current script you have (dont change the code), make sure it is a local script. parent it to StarterPlayerScripts, local scripts cant run when parented to the workspace so this should work

1 Like

I put that local script in StarterPlayerScript and it still doesn’t work

1 Like

Ok can you do all of the following

  • A: Take a screenshot of your workspace so we can see where everything is parented
  • B: Show us the code
  • C: Get me some food
    These would help a lot so we can help determine the problem
2 Likes

Maybe your not accessing “GuiAbilites” correctly; that’s why I keep asking the question. Would be helpful if you answered.

@FroDev1002 @Herbz_Dev2106
Screenshot 2024-08-11 210540

local AbilityList = game.Players.LocalPlayer.PlayerGui:WaitForChild("GuiAbilities")
local TouchPart = workspace.Obby.SelectAbilityRing.Part


TouchPart.Touched:Connect(function(part)
	if (part.Parent:FindFirstChildWhichIsA("Humanoid")) then
		local player = game.Players.GetPlayerFromCharacter(part.Parent)
		AbilityList.Enabled = true
		print("Work")
	end
end)

this is all the information I can offer
@FroDev1002 for helping me :green_apple:

Ok please again make the script a LOCAL SCRIPT, then parent the script to STARTERPLAYERSCRIPTS
Can you also show in the workspace where the GUI is parented?

1 Like

Assuming that “GuiAbilites” is a Gui that is placed in StarterGui, you should probably try and print the AbilityList variable to see if the Gui object is actually being found.