Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --Converted with ttyyuu12345's model to script plugin v4
- function sandbox(var,func)
- local env = getfenv(func)
- local newenv = setmetatable({},{
- __index = function(self,k)
- if k=="script" then
- return var
- else
- return env[k]
- end
- end,
- })
- setfenv(func,newenv)
- return func
- end
- cors = {}
- mas = Instance.new("Model",game:GetService("Lighting"))
- Tool0 = Instance.new("Tool")
- Script1 = Instance.new("Script")
- Part2 = Instance.new("Part")
- Sound3 = Instance.new("Sound")
- Sound4 = Instance.new("Sound")
- Sound5 = Instance.new("Sound")
- BillboardGui6 = Instance.new("BillboardGui")
- TextLabel7 = Instance.new("TextLabel")
- SpecialMesh8 = Instance.new("SpecialMesh")
- LocalScript9 = Instance.new("LocalScript")
- LocalScript10 = Instance.new("LocalScript")
- Tool0.Name = "CB{Cylinderball}"
- Tool0.Parent = mas
- Tool0.ToolTip = "It kinda looks like wheels"
- Tool0.CanBeDropped = false
- Script1.Name = "CannonBall"
- Script1.Parent = Tool0
- Script1.Disabled = true
- table.insert(cors,sandbox(Script1,function()
- local Ball = script.Parent
- local damage = 10
- local r = game:service("RunService")
- local debris = game:GetService("Debris")
- local last_sound_time = r.Stepped:wait()
- function onTouched(hit)
- if hit.Parent == nil then return end
- local now = r.Stepped:wait()
- if (now - last_sound_time > .1) then
- Ball.Boing:play()
- last_sound_time = now
- else
- return
- end
- local humanoid = hit.Parent:FindFirstChild("Humanoid")
- if humanoid ~=nil then
- tagHumanoid(humanoid)
- humanoid:TakeDamage(damage)
- if connection then connection:disconnect() end
- else
- damage = damage / 2
- if damage < 2 then
- if connection then connection:disconnect() end
- end
- end
- end
- function tagHumanoid(humanoid)
- local tag = Ball:findFirstChild("creator")
- if tag ~= nil then
- local new_tag = tag:clone()
- new_tag.Parent = humanoid
- debris:AddItem(new_tag, 2)
- end
- end
- connection = Ball.Touched:connect(onTouched)
- t, s = r.Stepped:wait()
- d = t + 10 - s
- while t < d do
- t = r.Stepped:wait()
- end
- Ball.Parent = nil
- end))
- Part2.Name = "Handle"
- Part2.Parent = Tool0
- Part2.Material = Enum.Material.Glass
- Part2.BrickColor = BrickColor.new("Bright red")
- Part2.Rotation = Vector3.new(-180, 0, -180)
- Part2.Elasticity = 1
- Part2.FormFactor = Enum.FormFactor.Symmetric
- Part2.Friction = 0
- Part2.Shape = Enum.PartType.Ball
- Part2.Size = Vector3.new(2, 2, 2)
- Part2.CFrame = CFrame.new(0, 2, 0, -1, 0, 0, 0, 1, 0, 0, 0, -1)
- Part2.BottomSurface = Enum.SurfaceType.Smooth
- Part2.TopSurface = Enum.SurfaceType.Smooth
- Part2.Color = Color3.new(0.768628, 0.156863, 0.109804)
- Part2.Position = Vector3.new(0, 2, 0)
- Part2.Orientation = Vector3.new(0, 180, 0)
- Part2.Color = Color3.new(0.768628, 0.156863, 0.109804)
- Sound3.Name = "Boing"
- Sound3.Parent = Part2
- Sound3.Pitch = 1.1000000238419
- Sound3.SoundId = "http://www.roblox.com/Asset?ID=96543718"
- Sound4.Name = "Equip"
- Sound4.Parent = Part2
- Sound4.SoundId = "http://www.roblox.com/Asset?ID=97095034"
- Sound4.Volume = 0.80000001192093
- Sound5.Name = "Throw"
- Sound5.Parent = Part2
- Sound5.SoundId = "http://www.roblox.com/Asset?ID=97095069"
- BillboardGui6.Parent = Part2
- BillboardGui6.Size = UDim2.new(0, 200, 0, 50)
- BillboardGui6.Enabled = false
- BillboardGui6.AlwaysOnTop = true
- TextLabel7.Parent = BillboardGui6
- TextLabel7.Size = UDim2.new(0, 200, 0, 50)
- TextLabel7.Text = "You thrown the super ball of doom"
- TextLabel7.BackgroundColor3 = Color3.new(1, 1, 1)
- TextLabel7.Font = Enum.Font.SourceSans
- TextLabel7.FontSize = Enum.FontSize.Size14
- SpecialMesh8.Parent = Part2
- SpecialMesh8.MeshId = "rbxassetid://96501868"
- SpecialMesh8.Scale = Vector3.new(2, 2, 2)
- SpecialMesh8.TextureId = "rbxassetid://96502130"
- SpecialMesh8.VertexColor = Vector3.new(1, 0.375, 0.400000006)
- SpecialMesh8.MeshType = Enum.MeshType.FileMesh
- SpecialMesh8.Scale = Vector3.new(2, 2, 2)
- LocalScript9.Name = "MouseIcon"
- LocalScript9.Parent = Tool0
- table.insert(cors,sandbox(LocalScript9,function()
- local MOUSE_ICON = "rbxassetid://507449825"
- local RELOADING_ICON = "rbxassetid://507449806"
- local Tool = script.Parent
- local Mouse = nil
- local function UpdateIcon()
- if Mouse then
- Mouse.Icon = Tool.Enabled and MOUSE_ICON or RELOADING_ICON
- end
- end
- local function OnEquipped(mouse)
- Mouse = mouse
- UpdateIcon()
- end
- local function OnChanged(property)
- if property == 'Enabled' then
- UpdateIcon()
- end
- end
- Tool.Equipped:connect(OnEquipped)
- Tool.Changed:connect(OnChanged)
- end))
- LocalScript10.Parent = Tool0
- table.insert(cors,sandbox(LocalScript10,function()
- local Tool = script.Parent
- local Ball = Tool.Handle
- local Player = game.Players.LocalPlayer
- local Mouse = Player:GetMouse()
- function fire(direction)
- Tool.Handle.Throw:Play()
- local vCharacter = Tool.Parent
- local vPlayer = game.Players:playerFromCharacter(vCharacter)
- local missile = Instance.new("Part")
- local spawnPos = vCharacter.PrimaryPart.Position
- spawnPos = spawnPos + (direction * 5)
- missile.Material = "Granite"
- missile.Position = spawnPos
- missile.BrickColor = BrickColor.Random()
- missile.Size = Vector3.new(2,2,2)
- missile.Velocity = direction * 200
- missile.Shape = 0
- missile.CustomPhysicalProperties = PhysicalProperties.new(.6 ,.5, 1, 1, 1.75)
- missile.Name = "Dodgeball"
- missile.Elasticity = 1
- missile.Friction = .5
- local NewColor = BrickColor.random().Color
- Tool.Handle.Boing:clone().Parent = missile
- local new_script = script.Parent.CannonBall:clone()
- new_script.Disabled = false
- new_script.Parent = missile
- local creator_tag = Instance.new("ObjectValue")
- creator_tag.Value = vPlayer
- creator_tag.Name = "creator"
- creator_tag.Parent = missile
- missile.Parent = game.Workspace
- end
- enable = false
- i = 12
- function Shoot(key)
- if key == "q" then
- local character = Tool.Parent;
- local humanoid = character.Humanoid
- if humanoid == nil then
- print("Humanoid not found")
- return
- end
- local targetPos = humanoid.TargetPoint
- local lookAt = (targetPos - character.Head.Position).unit
- Tool.Handle.Transparency = 1
- for n = 1,i do
- wait()
- fire(lookAt)
- end
- wait(2)
- Tool.Handle.Transparency = 0
- while enable do
- wait()
- i = i + 1 * i
- if i < 80 then
- i = 0
- end
- end
- end
- end
- Mouse.KeyDown:connect(Shoot)
- Mouse.KeyUp:connect(function()
- enabled = true
- end)
- end))
- for i,v in pairs(mas:GetChildren()) do
- v.Parent = game:GetService("Players").LocalPlayer.Character
- pcall(function() v:MakeJoints() end)
- end
- mas:Destroy()
- for i,v in pairs(cors) do
- spawn(function()
- pcall(v)
- end)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement