Why is my gui not appearing when it touches the part?

I’ve been trying to fix this and I found this line makes the gui not appear.
Here’s my script that’s wrong:

local Powers = script.Parent.Parent.PowersFrame

local Ranks = script.Parent.Parent.RanksFrame

local Crates = script.Parent.Parent.CratesFrame

Powers.Visible = true -- The Part that's wrong.

Ranks.Visible = true -- The Part that's wrong.

Crates.Visible = true -- The Part that's wrong.

You are not using an function to fire it, so it will appear. Here is what you would have to do:

local Powers = script.Parent.Parent.PowersFrame

local Ranks = script.Parent.Parent.RanksFrame

local Crates = script.Parent.Parent.CratesFrame

local Part = game.Workspace.Part  -- Put the partname that u want to be touched

Part.Touched:Connect(function(hit)
if hit.Parent:FindFirstChild("Humanoid") then
Powers.Visible = true

Ranks.Visible = true 

Crates.Visible = true
        end
end)
2 Likes

Thanks for your help._________

1 Like