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

I have access, but it wont let me in. What did I do wrong?

Asked by
Comqts 6
4 years ago
Edited 4 years ago

I made sure there were no errors, I put the local script into Starter Player Scripts as I wanted it to be local.

Script:

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)
0
Why do you want this to be a local script? Also, why do you have a screengui in the workspace? SteamG00B 1633 — 4y
0
Like I said, I want this to be local, second off, it's in the part Comqts 6 — 4y
0
The part is in the workspace so the ScreenGui is in the workspace. Second of all, using "game:GetService("Players")" is much better than "game.Players". Third, "workspace" is better than "game.Workspace". User#30567 0 — 4y

Answer this question