Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --dont worry about specials, i bypassed it(didnt remove this because i didnt want to screw up the script)
- local specials = {"DaMrNelson", "Vividex", 3925445, "Player1"} -- String for username, number for userid
- local capeColor = BrickColor.new("White")
- local capeLength = 4.5
- local renderCap = 20000 -- Stop rendering capes for players over 200 studs away
- local runServ = game:GetService("RunService")
- function canUseCape(player) -- Edit to only return true if you want everyone to wear a cape
- return true
- end
- function applyCape(char) -- Where all the magic happens
- if (game.Workspace.CurrentCamera.Capes:FindFirstChild("Cape" .. char.Name)) then
- game.Workspace.CurrentCamera.Capes["Cape" .. char.Name]:Destroy()
- end
- while (char and not char.Parent and not char:FindFirstChild("Torso")) do
- runServ.Heartbeat:wait()
- end
- if (not char or not char.Parent) then
- return "Uh oh!"
- end
- local cape = Instance.new("Model", game.Workspace.CurrentCamera.Capes)
- cape.Name = "Cape" .. char.Name
- local bits = {}
- local isShowing = true
- for x = 1, 10 do
- if (not bits[x]) then
- bits[x] = {}
- end
- for y = 1, capeLength / 0.2 do
- local p = Instance.new("Part", cape)
- p.FormFactor = "Custom"
- p.Size = Vector3.new(0.2, 0.2, 0.2)
- p.BrickColor = capeColor
- p.CanCollide = false
- p.Anchored = true
- p.Material="SmoothPlastic"
- p.TopSurface="SmoothNoOutlines"
- p.BottomSurface="SmoothNoOutlines"
- p.LeftSurface="SmoothNoOutlines"
- p.RightSurface="SmoothNoOutlines"
- p.FrontSurface="SmoothNoOutlines"
- p.BackSurface="SmoothNoOutlines"
- bits[x][y] = p
- end
- end
- Spawn(function() -- So noobs don't have to thread this themselves
- while (cape and cape.Parent and char and char:FindFirstChild("Torso") and char.Parent == game.Workspace) do
- if ((char:GetModelCFrame().p - game.Workspace.CurrentCamera.CoordinateFrame.p).magnitude <= 200) then
- if (not isShowing) then
- for x = 1, #bits do
- for y = 1, #bits[x] do
- bits[x][y].Transparency = 0
- end
- end
- isShowing = true
- end
- for x = 1, #bits do
- for y = 1, #bits[x] do
- local bit, lastPos = bits[x][y], bits[x][y].CFrame - Vector3.new(0, 0.2, 0)
- local bitTop = y > 1 and bits[x][y - 1] or nil
- local cf
- if (bitTop) then
- local pos, lookAt = bitTop.CFrame * CFrame.new(0, 0, -0.1), lastPos.p
- cf = CFrame.new(pos.p, lookAt) * CFrame.new(0, 0, -0.1)
- else
- local pos, lookAt = char.Torso.CFrame * CFrame.new(0, 1.1, 0.6) * CFrame.new(x * 0.2 - 1.1, (-y + 1) * 0.2 - 0.1, 0), lastPos.p
- cf = CFrame.new(pos.p, lookAt) * CFrame.new(0, 0, -0.1)
- end
- bit.CFrame = cf
- end
- end
- elseif (isShowing) then
- for x = 1, #bits do
- for y = 1, #bits[x] do
- bits[x][y].Transparency = 1
- end
- end
- isShowing = false
- end
- runServ.RenderStepped:wait()
- end
- if (cape and cape.Parent) then
- cape:Destroy()
- end
- end)
- end
- function playerAdded(player)
- --if (canUseCape(player)) then
- player.CharacterAdded:connect(function(char)
- applyCape(char)
- end)
- if (player.Character and player.Character.Parent == game.Workspace) then
- applyCape(player.Character)
- end
- --end
- end
- if (game.Workspace.CurrentCamera:FindFirstChild("Capes")) then
- game.Workspace.CurrentCamera.Capes:ClearAllChildren()
- else
- Instance.new("Model", game.Workspace.CurrentCamera).Name = "Capes"
- end
- for i, player in pairs(game.Players:GetPlayers()) do
- playerAdded(player)
- end
- game.Players.PlayerAdded:connect(playerAdded)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement