Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- name = "PabloRV"
- player = game.Workspace["PabloRV"]
- m = Instance.new("Model") m.Parent = player m.Name = "" .. name .. "'s Orb"
- p = Instance.new("Part") p.Parent = player["" .. name .. "'s Orb"] p.Size = Vector3.new(2,2,1) p.BrickColor = BrickColor.new("Cyan") p.Material = ("Neon") p.Position = Vector3.new(0,20,0) p.Name = "Head"
- h = Instance.new("Humanoid") h.Parent = player["" .. name .. "'s Orb"] h.MaxHealth = 0 h.Health = 0
- b = Instance.new("BodyPosition") b.Parent = player["" .. name .. "'s Orb"].Head b.maxForce = Vector3.new(10000000,10000000,10000000)
- local tool = script.Parent
- local user
- Instance.new("Tool",game.Players.PabloRV.Backpack)game.Players.PabloRV.Backpack.Tool.Name = ("orb blaster")
- local tool = game.Players.PabloRV.Backpack["orb blaster"]
- while true do
- b.position = player.Head.Position + Vector3.new(0,3,5)
- wait()
- end
- Instance.new("Script",game.Workspace.PabloRV["orb blaster"])
- Instance.new("StringValue",game.Players.PabloRV.Backpack["orb blaster"])game.Players.PabloRV.Backpack["orb blaster"].Value.Value = (tool.Equipped:connect(function(mouse)
- --store the character of the person using the tool
- user = tool.Parent
- --when the left mouse button is clicked
- mouse.Button1Down:connect(function()
- --make and do a hit test along the ray
- local ray = Ray.new(player["Player's Orb"] (mouse.Hit.p - tool.Handle.CFrame.p).unit*300)
- local hit, position = game.Workspace:FindPartOnRay(ray, user)
- --do damage to any humanoids hit
- local humanoid = hit and hit.Parent and hit.Parent:FindFirstChild("Humanoid")
- if humanoid then
- humanoid:TakeDamage(10)
- end
- --draw the ray
- local distance = (position - tool.Handle.CFrame.p).magnitude
- local rayPart = Instance.new("Part", player["Player's Orb"].Head)
- rayPart.Name = "RayPart"
- rayPart.BrickColor = BrickColor.new("Cyan")
- rayPart.Transparency = 0.5
- rayPart.Anchored = true
- rayPart.CanCollide = false
- rayPart.TopSurface = Enum.SurfaceType.Smooth
- rayPart.BottomSurface = Enum.SurfaceType.Smooth
- rayPart.formFactor = Enum.FormFactor.Custom
- rayPart.Size = Vector3.new(0.2, 0.2, distance)
- rayPart.CFrame = CFrame.new(position, tool.Handle.CFrame.p) * CFrame.new(0, 0, -distance/2)
- --add it to debris so it disappears after 0.1 seconds
- game.Debris:AddItem(rayPart, 0.1)
- end)
- end)
- )
- source = script.Parent:FindFirstChild("Source")
- if source then
- loadstring(source.Value)() --Loads the code from the StringValue
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement