Cant enable GUI with script inside of model.s

Hello, i have this issue where my script needs to enable a GUI that’s in StarterGui but its not enabling it.
here is a picture of where the code/script is and what it needs to enable:
image
here is my code:

script.Parent.Triggered:Connect(function()
	script.Parent.Parent.Parent.Parent.Parent.StarterGui.ScreenGuiCraft.Enabled = true
	script.Parent.Parent.Parent.Parent.Parent.StarterGui.ScreenGuiCraft.Frame.Active = true
	
end)

anybody know how to enable the gui?

StarterGui clones it’s content to the player inside game.Players.PlayerGui.
If I remember correctly the ProximityPrompt can tell which player is triggering it so you could do this.

script.Parent.Triggered:Connect(function(player)
	player.PlayerGui.ScreenGuiCraft.Enabled = true
	player.PlayerGui.ScreenGuiCraft.Frame.Active = true
end)

did not work, no errors tho. so yeah

u dont mean Visible?

script.Parent.Triggered:Connect(function(player)
	player.PlayerGui.ScreenGuiCraft.Enabled = true
	player.PlayerGui.ScreenGuiCraft.Frame.Visible = true
end)

or try to change to script bc the function gets only the player that triggered

1 Like

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