Not too sure what im doing wrong here, but I want this ScreenGui to appear when the player clicks on the NPC, well when the player does click on the NPC the script does work to a degree bec the player is anchored until they close out of the Gui (separate script). But the issue is i cant get the Gui to open only close... Ive tried it with and without the Frame and ive been at this for a few hours now and i just dont know what it is im doing wrong. please help
local clickdetector = game.Workspace.PalletTown1.NPCs.Kryptio.ClickDetector
clickdetector.MouseClick:Connect (function()
local ScreenGui = game.StarterGui.KryptioGui.Frame
if ScreenGui.Visible == false then
game.Players.LocalPlayer.Character.Torso.Anchored = true
ScreenGui.Visible = true
end
ScreenGui.KryptioClickDetectorEvent:FireServer()
end)

4 comments
Also if my question is too broad just let me know.
Not to be rude or anything, but i suggest you don't make a pokemon game, as they are extremely complex, if you make mistakes like this. (Suppose its a pokemon game because of "PelletTown".)
and i suggest dont tell someone not to do something like that, ive only just started scripting and i find that really disrespectful. I already have ideas on how to make the pokemon game work its just the stupid things i dont understand
If you think about remaking something like brick bronze, barely anyone would be able to do it, just want to point that out.