Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- tracer
- local folder=Instance.new("Folder",workspace)
- folder.Name="Tracers"
- function update(plr)
- local info=folder[plr.Name].length.Value
- if game.Players.LocalPlayer.Character then
- if info>(game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame.p-plr.Character.HumanoidRootPart.Position).magnitude or info<(game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame.p-plr.Character.HumanoidRootPart.Position).magnitude then
- local dist=(game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame.p-plr.Character.HumanoidRootPart.Position).magnitude
- folder[plr.Name].Size=Vector3.new(0.2,0.2,dist)
- folder[plr.Name].CFrame= CFrame.new(game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame.p, plr.Character.HumanoidRootPart.Position)*CFrame.new(0,0,-dist/2)
- end
- end
- end
- function deletebeam(plr)
- for i,v in pairs(folder:GetChildren()) do
- if v.Name==plr.Name then
- v:Destroy()
- end
- end
- end
- function beam(plr)
- deletebeam(plr)
- if game.Players.LocalPlayer.Character and plr.Character and game.Players[plr.Name] and plr.Character["HumanoidRootPart"] then
- local ray=Ray.new(game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame.p, (plr.Character.HumanoidRootPart.CFrame.p-game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame.p).unit*300)
- local part=plr.Character.HumanoidRootPart
- local pos=plr.Character.HumanoidRootPart.Position
- local trac=Instance.new("Part",folder)
- local length=Instance.new("IntValue",trac)
- length.Name="length"
- trac.Name=plr.Name
- trac.BrickColor=BrickColor.new("White")
- coroutine.resume(coroutine.create(function()
- while folder:FindFirstChild(plr.Name) do
- if plr.Character:FindFirstChildOfClass("Tool") and trac.BrickColor==BrickColor.new("White") then
- trac.BrickColor=BrickColor.new("Camo")
- game:GetService("RunService").RenderStepped:Wait()
- else
- break
- end
- end
- end))
- coroutine.resume(coroutine.create(function()
- while folder:FindFirstChild(plr.Name) do
- if #game.Teams:GetChildren()<=1 then
- break
- else
- for i,v in pairs(game.Teams:GetChildren()) do
- for x,d in pairs(v:GetPlayers()) do
- if d==plr then
- trac.BrickColor=v.TeamColor
- game:GetService("RunService").RenderStepped:Wait()
- end
- end
- end
- end
- end
- end))
- trac.FormFactor="Custom"
- trac.Material="Neon"
- trac.Transparency = 0.5
- trac.Anchored = true
- trac.CanCollide = false
- local distance=(game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame.p-pos).magnitude
- length.Value=distance
- trac.Size=Vector3.new(0.2,0.2,dist)
- trac.CFrame= CFrame.new(game.Players.LocalPlayer.Character.HumanoidRootPart.CFrame.p, pos)*CFrame.new(0,0,-distance/2)
- coroutine.resume(coroutine.create(function()
- while folder:FindFirstChild(plr.Name) do
- if game.Players[plr.Name] then
- update(plr)
- game:GetService("RunService").RenderStepped:Wait()
- else
- deletebeam(plr)
- game:GetService("RunService").RenderStepped:Wait()
- end
- end
- end))
- end
- end
- for i,v in pairs(game:GetService"Players":GetPlayers()) do
- if v~=game.Players.LocalPlayer then
- beam(v)
- v.CharacterAdded:connect(function()
- wait(.5)
- beam(v)
- end)
- end
- end
- game.Players.PlayerAdded:connect(function(plr)
- repeat wait() until plr.Character:FindFirstChild("HumanoidRootPart")~=nil
- beam(plr)
- print(plr.Name.."Added")
- end)
- game.Players.ChildRemoved:connect(function(part)
- if part:IsA("Player") then
- deletebeam(part)
- end
- end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement