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

Why wont this script work?

Asked by
s_21 74
8 years ago

I joined FEAR to test it but it still let me in... Second time It broke...

function createGui(player)
    local x = Instance.new("ScreenGui", player.PlayerGui)
    local frame = Instance.new("Frame", x)
    local label = Instance.new("TextLabel", frame)

    frame.Size = UDim2.new(1, 0, 1, 0)
    label.Size = UDim2.new(1, 0, 1, 0)
    label.FontSize = "Size48"
    label.Text = "You have been detected as a FEAR member. Quit FEAR to be able to play, because FEAR is for Is our arch enemy..."
    label.BackgroundColor3 = Color3.new(0, 0, 0)
    label.TextColor3 = Color3.new(1, 1, 1)    label.TextWrap = true
end

game.Players.childAdded:connect(function(newb)
    if newb:IsInGroup(72321) then

        repeat
        print("WAITING FER NEWB!  ")
        wait()
        until newb.Character ~= nil

        newb.Character:MoveTo(Vector3.new(0, 100000, 0))
        newb.Character.Torso.Anchored = true
        newb.Backpack:Remove()
        for index, gui in pairs(newb.PlayerGui:GetChildren()) do
            gui:Remove()
        end
        createGui(newb)
    else
        print("YOU'RE CLEAR!  ")
    end
end)

1 answer

Log in to vote
0
Answered by 8 years ago

First of all you are waiting until character does not exist; nil.

repeat
print("WAITING FER NEWB!  ")
wait()
until newb:FindFirstChild("Character")

Second, I am pretty sure you would have to move the torso, not the character

newb.Character.Torso:MoveTo(Vector3.new(0, 100000, 0))

I couldn't find any more, have you checked the output?

Ad

Answer this question