roblonium-web/Game/FinobeTools/BanHammer.rbxm

437 lines
16 KiB
Plaintext

<roblox xmlns:xmime="http://www.w3.org/2005/05/xmlmime" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="http://www.roblox.com/roblox.xsd" version="4">
<External>null</External>
<External>nil</External>
<Item class="Tool" referent="RBX0">
<Properties>
<bool name="Enabled">true</bool>
<CoordinateFrame name="Grip">
<X>0</X>
<Y>-1</Y>
<Z>0</Z>
<R00>1</R00>
<R01>0</R01>
<R02>0</R02>
<R10>0</R10>
<R11>1</R11>
<R12>0</R12>
<R20>0</R20>
<R21>0</R21>
<R22>1</R22>
</CoordinateFrame>
<string name="Name">BanHammer</string>
<Content name="TextureId"><url>http://www.roblox.com/asset/?id=10684453</url></Content>
</Properties>
<Item class="Part" referent="RBX1">
<Properties>
<bool name="Anchored">false</bool>
<float name="BackParamA">-0.5</float>
<float name="BackParamB">0.5</float>
<token name="BackSurface">0</token>
<token name="BackSurfaceInput">0</token>
<float name="BottomParamA">-0.5</float>
<float name="BottomParamB">0.5</float>
<token name="BottomSurface">4</token>
<token name="BottomSurfaceInput">0</token>
<int name="BrickColor">194</int>
<CoordinateFrame name="CFrame">
<X>-0.259155273</X>
<Y>3.43653774</Y>
<Z>0.389560699</Z>
<R00>-0.309529573</R00>
<R01>-0.260076046</R01>
<R02>0.914632022</R02>
<R10>0.0592671633</R10>
<R11>0.954722881</R11>
<R12>0.291533053</R12>
<R20>-0.94904089</R20>
<R21>0.144445777</R21>
<R22>-0.280100971</R22>
</CoordinateFrame>
<bool name="CanCollide">true</bool>
<float name="Elasticity">0.5</float>
<float name="Friction">0.300000012</float>
<float name="FrontParamA">-0.5</float>
<float name="FrontParamB">0.5</float>
<token name="FrontSurface">0</token>
<token name="FrontSurfaceInput">0</token>
<float name="LeftParamA">-0.5</float>
<float name="LeftParamB">0.5</float>
<token name="LeftSurface">0</token>
<token name="LeftSurfaceInput">0</token>
<bool name="Locked">true</bool>
<token name="Material">256</token>
<string name="Name">Handle</string>
<float name="Reflectance">0</float>
<float name="RightParamA">-0.5</float>
<float name="RightParamB">0.5</float>
<token name="RightSurface">0</token>
<token name="RightSurfaceInput">0</token>
<Vector3 name="RotVelocity">
<X>0</X>
<Y>0</Y>
<Z>0</Z>
</Vector3>
<float name="TopParamA">-0.5</float>
<float name="TopParamB">0.5</float>
<token name="TopSurface">3</token>
<token name="TopSurfaceInput">0</token>
<float name="Transparency">0</float>
<Vector3 name="Velocity">
<X>0</X>
<Y>0</Y>
<Z>0</Z>
</Vector3>
<token name="formFactorRaw">1</token>
<token name="shape">1</token>
<Vector3 name="size">
<X>1</X>
<Y>6</Y>
<Z>1</Z>
</Vector3>
</Properties>
<Item class="SpecialMesh" referent="RBX2">
<Properties>
<token name="LODX">2</token>
<token name="LODY">2</token>
<Content name="MeshId"><url>http://www.roblox.com/asset/?id=10604848</url></Content>
<token name="MeshType">5</token>
<string name="Name">Mesh</string>
<Vector3 name="Offset">
<X>0</X>
<Y>0</Y>
<Z>0</Z>
</Vector3>
<Vector3 name="Scale">
<X>0.5</X>
<Y>0.5</Y>
<Z>0.5</Z>
</Vector3>
<Content name="TextureId"><url>http://www.roblox.com/asset/?id=10605252</url></Content>
<Vector3 name="VertexColor">
<X>1</X>
<Y>1</Y>
<Z>1</Z>
</Vector3>
</Properties>
</Item>
<Item class="Decal" referent="RBX3">
<Properties>
<token name="Face">2</token>
<string name="Name">Decal</string>
<float name="Shiny">20</float>
<float name="Specular">0</float>
<Content name="Texture"><url>http://www.roblox.com/asset/?id=10605252</url></Content>
<float name="Transparency">0</float>
</Properties>
</Item>
</Item>
<Item class="BoolValue" referent="RBX4">
<Properties>
<string name="Name">MouseClick</string>
<bool name="Value">false</bool>
</Properties>
</Item>
<Item class="Animation" referent="RBX5">
<Properties>
<Content name="AnimationId"><url>http://www.roblox.com/Asset?ID=54673790</url></Content>
<string name="Name">HomeRun</string>
</Properties>
</Item>
<Item class="Animation" referent="RBX6">
<Properties>
<Content name="AnimationId"><url>http://www.roblox.com/Asset?ID=48138189</url></Content>
<string name="Name">TwoHandAnim</string>
</Properties>
</Item>
<Item class="Animation" referent="RBX7">
<Properties>
<Content name="AnimationId"><url>http://www.roblox.com/Asset?ID=32659706</url></Content>
<string name="Name">Whack</string>
</Properties>
</Item>
<Item class="LocalScript" referent="RBX8">
<Properties>
<bool name="Disabled">true</bool>
<Content name="LinkedSource"><null></null></Content>
<string name="Name">_CamShake</string>
<ProtectedString name="Source">local cam = game.Workspace.CurrentCamera
for i = 1, 5 do
wait()
local cam_rot = cam.CoordinateFrame - cam.CoordinateFrame.p --* CFrame.fromEulerAnglesXYZ(math.random(-10, 10)/10, math.random(-10, 10)/10, 0)
local cam_scroll = (cam.CoordinateFrame.p - cam.Focus.p).magnitude
local ncf = CFrame.new(cam.Focus.p)*cam_rot*CFrame.fromEulerAnglesXYZ(math.random(-10, 10)/40, math.random(-10, 10)/40, 0)
cam.CoordinateFrame = ncf*CFrame.new(0, 0, cam_scroll)
end
script:remove()
</ProtectedString>
</Properties>
</Item>
<Item class="LocalScript" referent="RBX9">
<Properties>
<bool name="Disabled">false</bool>
<Content name="LinkedSource"><null></null></Content>
<string name="Name">_EVT</string>
<ProtectedString name="Source">script.Parent.Equipped:connect(function(mouse)
&#9;mouse.Button1Down:connect(function()
&#9;&#9;script.Parent.MouseClick.Value = not script.Parent.MouseClick.Value
&#9;end)
end)</ProtectedString>
</Properties>
</Item>
<Item class="Script" referent="RBX10">
<Properties>
<bool name="Disabled">false</bool>
<Content name="LinkedSource"><null></null></Content>
<string name="Name">_SoundDetection</string>
<ProtectedString name="Source">hammer = script.Parent.Handle
local HomerunSound = Instance.new(&quot;Sound&quot;)
HomerunSound.SoundId = &quot;http://www.roblox.com/asset/?id=21343225&quot;
HomerunSound.Parent = hammer
HomerunSound.Volume = 0.5
HomerunSound.Name = &quot;Homerun&quot;
local WhackSound = Instance.new(&quot;Sound&quot;)
WhackSound.SoundId = &quot;http://www.roblox.com/asset/?id=10730819&quot;
WhackSound.Parent = hammer
WhackSound.Volume = 1
WhackSound.Name = &quot;Whack&quot;
hammer.ChildAdded:connect(function(Child)
&#9;wait()
&#9;if Child.className == &quot;StringValue&quot; then
&#9;&#9;if Child.Name == &quot;HomerunSound&quot; then
&#9;&#9;&#9;HomerunSound:Play()
&#9;&#9;elseif Child.Name == &quot;WhackSound&quot; then
&#9;&#9;&#9;WhackSound:Play()
&#9;&#9;end
&#9;&#9;Child:Remove()
&#9;end
end)</ProtectedString>
</Properties>
</Item>
<Item class="LocalScript" referent="RBX11">
<Properties>
<bool name="Disabled">false</bool>
<Content name="LinkedSource"><null></null></Content>
<string name="Name">_Main</string>
<ProtectedString name="Source">--Credits: xLEGOx for the first creation of the hammer, Luckymaxer for fixing it, BLOX31 for the ideas and animation, gkku for visual design, sounds, and various fixes
--player
player = nil
--selected
selected = false
homerunning = false
whacking = false
--save shoulders
RSH, LSH = nil, nil
anim = &quot;none&quot;
--grip
--welds
--what anim
local TwoHandAnim
local HomeRunner
local Whacker
--create the dustcloud object
local prt = Instance.new(&quot;Part&quot;)
prt.Size = Vector3.new(7.5,7.5,7.5)
prt.BrickColor = BrickColor.new(217)
prt.Anchored = true
prt.CanCollide = false
prt.Transparency = 1
smoke=Instance.new(&quot;Smoke&quot;, prt)
smoke.Color = BrickColor.new(&quot;Brown&quot;).Color
smoke.RiseVelocity = -2
smoke.Size = 4.5
smoke.Opacity = 1
--set variables
hammer = script.Parent.Handle
--[[local msh = Instance.new(&quot;SpecialMesh&quot;)
msh.MeshId = &quot;http://www.roblox.com/asset/?id=1095708&quot;
msh.MeshType = 5
msh.Parent = prt]]
----- show version ----------
script.Parent.Name = &quot;BanHammer V1.1&quot;
---------------------------------
function GetFigures(Parent, Part)
&#9;for i, v in pairs(Parent:GetChildren()) do
&#9;&#9;GetFigures(v, Part)
&#9;&#9;if v.className == &quot;Humanoid&quot; then
&#9;&#9;&#9;if v == script.Parent.Parent:findFirstChild(&quot;Humanoid&quot;) == false then
&#9;&#9;&#9;&#9;if v.Parent:findFirstChild(&quot;Torso&quot;) then
&#9;&#9;&#9;&#9;&#9;if v.Parent:findFirstChild(&quot;Torso&quot;):IsA(&quot;BasePart&quot;) then
&#9;&#9;&#9;&#9;&#9;&#9;if v.Parent:findFirstChild(&quot;Torso&quot;).Position.x &lt; Part.Position.x + Part.Size.x / 2
&#9;&#9;&#9;&#9;&#9;&#9;and v.Parent:findFirstChild(&quot;Torso&quot;).Position.x &gt; Part.Position.x - Part.Size.x / 2
&#9;&#9;&#9;&#9;&#9;&#9;and v.Parent:findFirstChild(&quot;Torso&quot;).Position.y &lt; Part.Position.y + Part.Size.y / 2
&#9;&#9;&#9;&#9;&#9;&#9;and v.Parent:findFirstChild(&quot;Torso&quot;).Position.y &gt; Part.Position.y - Part.Size.y / 2
&#9;&#9;&#9;&#9;&#9;&#9;and v.Parent:findFirstChild(&quot;Torso&quot;).Position.z &lt; Part.Position.z + Part.Size.z / 2
&#9;&#9;&#9;&#9;&#9;&#9;and v.Parent:findFirstChild(&quot;Torso&quot;).Position.z &gt; Part.Position.z - Part.Size.z / 2 then
&#9;&#9;&#9;&#9;&#9;&#9;&#9;v.Sit = true
&#9;&#9;&#9;&#9;&#9;&#9;end
&#9;&#9;&#9;&#9;&#9;&#9;if (Part.Position - v.Parent:findFirstChild(&quot;Torso&quot;).Position).magnitude &lt; 10 then
&#9;&#9;&#9;&#9;&#9;&#9;&#9;v.Sit = true
&#9;&#9;&#9;&#9;&#9;&#9;end
&#9;&#9;&#9;&#9;&#9;end
&#9;&#9;&#9;&#9;end
&#9;&#9;&#9;end
&#9;&#9;end
&#9;end
end
function Raycast(Pos, Dir, Max, Ignore)
return game:GetService(&quot;Workspace&quot;):FindPartOnRay(Ray.new(Pos, Dir.unit * (Max or 999.999)), Ignore)
end
function WaitForChild(obj, ch_n)
&#9;local t = time()
&#9;while not obj:FindFirstChild(ch_n) and time() - t &lt; 10 do wait(0.1) end
&#9;return obj:FindFirstChild(ch_n)
end
--onselected, save shoulders and get player
script.Parent.Equipped:connect(function()
&#9;TwoHandAnim = script.Parent.Parent:findFirstChild(&quot;Humanoid&quot;):LoadAnimation(script.Parent.TwoHandAnim)
&#9;HomeRunner = script.Parent.Parent:findFirstChild(&quot;Humanoid&quot;):LoadAnimation(script.Parent.HomeRun)
&#9;Whacker = script.Parent.Parent:findFirstChild(&quot;Humanoid&quot;):LoadAnimation(script.Parent.Whack)
&#9;repeat wait() until TwoHandAnim ~= nil and HomeRunner ~= nil and Whacker ~= nil
&#9;if selected then return end
&#9;selected = true
&#9;TwoHandAnim:Play()
end)
--griptcf = CFrame.new(0, -1, 0) * CFrame.fromEulerAnglesXYZ(-math.pi/2+0.5, 0, 0)
script.Parent.Unequipped:connect(function()
&#9;selected = false
&#9;if TwoHandAnim ~= nil then
&#9;&#9;TwoHandAnim:Stop()
&#9;end
&#9;if HomeRunner ~= nil then
&#9;&#9;HomeRunner:Stop()
&#9;end
&#9;if Whacker ~= nil then
&#9;&#9;Whacker:Stop()
&#9;end
end)
function HomeRunHit(part)
&#9;if part == nil then return end
&#9;if part.Parent == nil then return end
&#9;local h = (part.Parent or game):FindFirstChild(&quot;Humanoid&quot;) --or findfirstchild optimization
&#9;if h then
&#9;&#9;if h == script.Parent.Parent:findFirstChild(&quot;Humanoid&quot;) == false then
&#9;&#9;&#9;--game.SoundService.Bomb:Play()
&#9;--&#9;&#9;hammer.Homerun:Play()
&#9;&#9;&#9;hrs = Instance.new(&quot;StringValue&quot;)
&#9;&#9;&#9;hrs.Name = &quot;HomerunSound&quot;
&#9;&#9;&#9;hrs.Parent = hammer
&#9;&#9;&#9;h.Sit = true
&#9;&#9;&#9;h.Parent.Torso.Velocity = (CFrame.new(hammer.Position, h.Parent.Torso.Position).lookVector * 200) + Vector3.new(0, 100, 0)
&#9;&#9;&#9;h.Parent.Torso.RotVelocity = Vector3.new(math.random(-100, 100), math.random(-100, 100), math.random(-100, 100))
&#9;&#9;end
&#9;end
end
function HomeRun()
&#9;if homerunning == false then
&#9;&#9;homerunning = true
&#9;&#9;anim = &quot;homerun&quot;
&#9;&#9;TwoHandAnim:Stop()
&#9;&#9;HomeRunner:Play()
&#9;&#9;--start HomeRunhit connection--
&#9;&#9;local con = hammer.Touched:connect(HomeRunHit)
&#9;&#9;----------------------------------------
&#9;&#9;wait(.6)
&#9;&#9;HomeRunner:Stop()
&#9;&#9;if selected == true then
&#9;&#9;&#9;TwoHandAnim:Play()
&#9;&#9;end
&#9;&#9;----end HomeRun connection---
&#9;&#9;con:disconnect()
&#9;--&#9;wait(0.15)
&#9;&#9;homerunning = false
&#9;end
end
function Whack()
&#9;if homerunning == false then
&#9;anim = &quot;norm&quot;
&#9;TwoHandAnim:Stop()
&#9;Whacker:Play()
--&#9;hammer.Whack:Play()
&#9;&#9;--insert camshake and hit nearby people
&#9;&#9;for _, p in pairs(game.Players:GetChildren()) do
&#9;&#9;&#9;if p.Character == script.Parent.Parent == false then
&#9;&#9;&#9;&#9;if p.Character:FindFirstChild(&quot;Torso&quot;) then
&#9;&#9;&#9;&#9;&#9;if (p.Character.Torso.Position - (hammer.CFrame*CFrame.new(0, 3, 0)).p).magnitude &lt; 15 then
&#9;&#9;&#9;&#9;&#9;&#9;local s = script.Parent._CamShake:clone()
&#9;&#9;&#9;&#9;&#9;&#9;s.Disabled = false
&#9;&#9;&#9;&#9;&#9;&#9;s.Parent = p.Backpack
&#9;&#9;&#9;&#9;&#9;&#9;if p ~= player then
&#9;&#9;--&#9;&#9;&#9;&#9;&#9;p.Character.Humanoid.Sit = true
&#9;&#9;--&#9;&#9;&#9;&#9;&#9;delay(0.1, function() p.Character.Humanoid.Jump = true end)
&#9;&#9;&#9;&#9;&#9;&#9;&#9;p.Character.Torso.RotVelocity = Vector3.new(math.random(-10, 10), math.random(-10, 10), math.random(-10, 10))
&#9;&#9;&#9;&#9;&#9;&#9;end
&#9;&#9;&#9;&#9;&#9;end
&#9;&#9;&#9;&#9;end
&#9;&#9;&#9;end
&#9;&#9;end
&#9;&#9;--add dust cloud
&#9;&#9;delay(0.25, function()
&#9;&#9;&#9;if anim == &quot;norm&quot; then
&#9;&#9;&#9;&#9;if selected == true then
&#9;&#9;&#9;&#9;&#9;whacking = true
&#9;&#9;&#9;&#9;&#9;p=Instance.new(&quot;Part&quot;)
&#9;&#9;&#9;&#9;&#9;p.CanCollide = false
&#9;&#9;&#9;&#9;&#9;p.Transparency = 1
&#9;&#9;&#9;&#9;&#9;p.Parent = script.Parent.Parent
&#9;&#9;&#9;&#9;&#9;p.formFactor = &quot;Custom&quot;
&#9;&#9;&#9;&#9;&#9;p.Size = Vector3.new(0.2, 0.2, 0.2)
&#9;&#9;&#9;&#9;&#9;p.Anchored = true
&#9;&#9;&#9;&#9;&#9;p.CFrame = hammer.CFrame - Vector3.new(0, script.Parent.Parent:findFirstChild(&quot;Torso&quot;).Size.y/2, 0) + script.Parent.Parent:findFirstChild(&quot;Torso&quot;).CFrame.lookVector * ((hammer.Size.y / 2) - p.Size.z)
&#9;&#9;&#9;&#9;&#9;p.CFrame = CFrame.new(p.CFrame.p) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))
&#9;&#9;&#9;&#9;&#9;p.CFrame = p.CFrame * CFrame.fromEulerAnglesXYZ(-math.pi/2, 0, -math.pi/2)
&#9;&#9;&#9;&#9;&#9;Hit, Pos = Raycast(p.Position, p.CFrame.lookVector, 4, script.Parent.Parent)
&#9;&#9;&#9;&#9;&#9;if Hit ~= nil then
&#9;&#9;&#9;&#9;&#9;&#9;if homerunning == false then
&#9;&#9;&#9;&#9;&#9;&#9;&#9;delay(0.35, function()
&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;w = Instance.new(&quot;StringValue&quot;)
&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;w.Name = &quot;WhackSound&quot;
&#9;&#9;&#9;&#9;&#9;&#9;&#9;&#9;w.Parent = hammer
&#9;&#9;&#9;&#9;&#9;&#9;&#9;end)
&#9;&#9;&#9;&#9;&#9;&#9;&#9;local pt = prt:clone()
&#9;&#9;&#9;&#9;&#9;&#9;&#9;pt.Parent = script.Parent.Parent
&#9;&#9;&#9;&#9;&#9;&#9;&#9;pt.CFrame = CFrame.new(hammer.CFrame.x, Pos.y + 0.75, hammer.CFrame.z) + script.Parent.Parent:findFirstChild(&quot;Torso&quot;).CFrame.lookVector * 1.75
&#9;&#9;&#9;&#9;&#9;&#9;&#9;GetFigures(pt.Parent.Parent, pt)
&#9;&#9;&#9;&#9;&#9;&#9;&#9;game.Debris:addItem(pt, 1.3)
&#9;&#9;&#9;&#9;&#9;&#9;end
&#9;&#9;&#9;&#9;&#9;end
&#9;&#9;&#9;&#9;&#9;p:Remove()
&#9;&#9;&#9;&#9;end
&#9;&#9;&#9;end
&#9;&#9;end)
&#9;&#9;wait(0.75)
&#9;&#9;Whacker:Stop()
&#9;&#9;whacking = false
&#9;&#9;------
&#9;&#9;if selected == true then
&#9;&#9;&#9;TwoHandAnim:Play()
&#9;&#9;end
&#9;end
end
local a = false
local co = nil
--OMGHAX mouseclick
local last_click = 0
script.Parent.MouseClick.Changed:connect(function()
&#9;if homerunning == false and whacking == false then
&#9;&#9;if time() - last_click &lt; 0.3 then
&#9;&#9;&#9;anim = &quot;homerun&quot;
&#9;&#9;&#9;last_click = time()
&#9;&#9;&#9;HomeRun()
&#9;&#9;else
&#9;&#9;&#9;anim = &quot;norm&quot;
&#9;&#9;&#9;last_click = time()
&#9;&#9;&#9;Whack()
&#9;&#9;end
&#9;end
end)</ProtectedString>
</Properties>
</Item>
</Item>
</roblox>