Gui only pops up only once in a touch-fired script?
I'm trying to make a GUI pop up when an invisible brick is touched, and lets people of a certain rank through. The rank part works fine, but the GUI script only runs once. I also have MADE SURE the GUI is destroyed in some way, and doesn't stay there out of sight.
My code:
01 | local config = script.Parent.Configuration |
02 | script.Parent.Touched:connect( function (part) |
03 | if part.Parent and game:GetService( 'Players' ):GetPlayerFromCharacter(part.Parent) then |
04 | local player = game:GetService( 'Players' ):GetPlayerFromCharacter(part.Parent) |
05 | if player:GetRankInGroup(config.GroupId.Value) > = config.RankId.Value then |
06 | if not player.PlayerGui:FindFirstChild( "MakeGui" ) then |
07 | script.Parent.MakeGui:Clone().Parent = player.PlayerGui |
09 | script.Parent.CanCollide = false |
11 | script.Parent.CanCollide = true |
Please help!