Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Why won't this script work?

I joined FEAR, To test my script, And it still let me in.. Now I've quit FEAR, It doesn't let me in...

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) == true 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

✓ Accepted answer

It's because if newb:IsInGroup(72321) == true thenisn't true.

All you needed is if newb:IsInGroup(72321) then`

So to fix it,

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)

3 comments

2

IsInGroup returns a boolean, which is either true or false. So either comparison is valid.

1

Right now I'm wondering if he just tested it in a live server, made sure it worked, the server stayed live because his friend was there or something, IsInGroup cached the result, he rejoined the server after leaving FEAR, then claimed it didn't work. That's the only way I see this script failing.

0

My friend wasn't there,

This discussion is preserved as it was. New answers, comments, and votes are closed.