Why won't it open when I have access to the door?
01 | game.Workspace.ElevatorAccess.Touched:Connect( function (hit) |
02 | local plr = game.Players:GetPlayerFromCharacter(hit.Parent) |
04 | local Rank = game.ReplicatedStorage.Rank |
06 | local MS = game:GetService( "MarketplaceService" ) |
07 | if hit and hit.Parent and game.Players:FindFirstChild(hit.Parent.Name) then |
08 | if game.Players [ hit.Parent.Name ] :IsInGroup(Group) and game.Players [ hit.Parent.Name ] :GetRankInGroup(Group) > = Rank then |
09 | local Ui = game.Workspace.ElevatorAccess.ScreenGui |
10 | local Ui 2 = Ui:Clone() |
12 | Ui 2. Parent = plr.PlayerGui |
13 | elseif MS:UserOwnsGamePassAsync(plr.UserId, gamepass) then |
14 | local Ui = game.Workspace.ElevatorAccess.ScreenGui |
15 | local Ui 2 = Ui:Clone() |
17 | Ui 2. Parent = plr.PlayerGui |
19 | local frame = game.Workspace.ElevatorAccess.SurfaceGui.Frame |
20 | frame:TweenPosition(UDim 2. new( 0 , 0 , 0 , 0 )) |
22 | frame:TweenPosition(UDim 2. new(- 1 , 0 , 0 , 0 )) |
It's in Starter Player Scripts as I want it local for the player.