Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why won't it open when I have access to the door?

Asked by
Comqts 6
3 years ago
game.Workspace.ElevatorAccess.Touched:Connect(function(hit)
    local plr = game.Players:GetPlayerFromCharacter(hit.Parent)
    local Group = 5762728
    local Rank = game.ReplicatedStorage.Rank
    local gamepass = 0
    local MS = game:GetService("MarketplaceService")
    if hit and hit.Parent and game.Players:FindFirstChild(hit.Parent.Name)then
        if game.Players[hit.Parent.Name]:IsInGroup(Group) and game.Players[hit.Parent.Name]:GetRankInGroup(Group) >= Rank then
            local Ui = game.Workspace.ElevatorAccess.ScreenGui
            local Ui2 = Ui:Clone()
            Ui2.Name = "TP"
            Ui2.Parent = plr.PlayerGui
        elseif MS:UserOwnsGamePassAsync(plr.UserId, gamepass) then
            local Ui = game.Workspace.ElevatorAccess.ScreenGui
            local Ui2 = Ui:Clone()
            Ui2.Name = "TP"
            Ui2.Parent = plr.PlayerGui
        else
            local frame = game.Workspace.ElevatorAccess.SurfaceGui.Frame
            frame:TweenPosition(UDim2.new(0, 0,0, 0))
            wait(2.5)
            frame:TweenPosition(UDim2.new(-1, 0,0, 0))
        end
    end
end)

It's in Starter Player Scripts as I want it local for the player.

0
Please clarify. Do you have any errors? Do you have a video of you touching the door? For more information see https://idownvotedbecau.se/UnclearQuestion User#30567 0 — 3y
0
No errors Comqts 6 — 3y

Answer this question