Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- lp = owner
- moving = false
- char = lp.Character
- head = char.Head
- torso = nil
- whitelisted = {}
- if char:FindFirstChild("Torso") then
- torso = char:FindFirstChild("Torso")
- elseif char:FindFirstChild("UpperTorso") then
- torso = char:FindFirstChild("UpperTorso")
- elseif char:FindFirstChild("Torso") ~= true and char:FindFirstChild("UpperTorso") ~= true then
- error("Torso not found, required")
- end
- base = Instance.new("Part",char)
- base.Anchored = true
- base.Size = Vector3.new(100,1,100)
- base.BrickColor = head.BrickColor
- base.CFrame = CFrame.new(math.random(-1000,1000),1000,math.random(-1000,1000))
- torso.CFrame = base.CFrame + Vector3.new(0,10,0)
- lp.Chatted:connect(function(msg)
- if string.sub(msg,1,string.len("b/allow/")) == "b/allow/" then
- victimname = string.sub(msg,string.len("b/allow/")+1,string.len(msg))
- table.insert(whitelisted,1,victimname)
- end
- if string.sub(msg,1,string.len("b/disallow/")) == "b/disallow/" then
- victimname = string.sub(msg,string.len("b/disallow/")+1,string.len(msg))
- for d=1, #whitelisted do
- if whitelisted[d].Name == victimname then
- table.remove(whitelisted,d)
- end
- end
- end
- if msg == "b/tp" then
- torso = nil
- char = lp.Character
- if char:FindFirstChild("Torso") then
- torso = char:FindFirstChild("Torso")
- elseif char:FindFirstChild("UpperTorso") then
- torso = char:FindFirstChild("UpperTorso")
- elseif char:FindFirstChild("Torso") ~= true and char:FindFirstChild("UpperTorso") ~= true then
- error("Torso not found, required")
- end
- torso.CFrame = base.CFrame + Vector3.new(0,10,0)
- end
- if msg == "b/move" then
- moving = true
- end
- if msg == "b/nomove" then
- moving = false
- end
- end)
- allowed = nil
- warn([[
- Chat commands:
- b/allow/[FULL player name] - whitelists a player so they can enter your base
- b/disallow/[FULL player name] - removes a whitelisted player so they can no longer enter your base
- b/tp - teleports you back to your base
- b/move - starts moving base
- b/nomove - stops moving base
- ]])
- while true do
- wait(0.01)
- if moving == true then
- base.CFrame = torso.CFrame - Vector3.new(0,1.8,0)
- end
- gc = game:GetService("Players"):GetPlayers()
- for g=1, #gc do
- if gc[g] ~= lp then
- if gc[g].Character ~= nil then
- if gc[g].Character:FindFirstChild("Head") then
- if (gc[g].Character:FindFirstChild("Head").Position - base.Position).magnitude < 150 then
- allowed = false
- for h=1, #whitelisted do
- if whitelisted[h] == gc[g].Name then
- allowed = true
- end
- end
- if allowed == false then
- if gc[g].Character ~= nil then
- gc[g].Character:ClearAllChildren()
- end
- end
- end
- end
- end
- end
- end
- end
Add Comment
Please, Sign In to add comment