local M=196.2 local n=tool.Configurations.ReloadTime.Value local e=tool.Configurations.RocketSpeed.Value local a="\104\116\116\112\058\047\047\119\119\119\046\114\111\098\108\111\120\046\099\111\109\047\097\115\115\101\116\047\063\105\100\061\050\050\053\049\053\051\052"local F=Vector3.new(.35,.35,.25)local Y=Vector3.new(1.2,1.2,3.27)local t=script:WaitForChild("\082\111\099\107\101\116")local P=script:WaitForChild("\083\119\111\111\115\104")local p=script:WaitForChild("\066\111\111\109")local k=tool.Configurations.AttackCooldown.Value local E=tool.Configurations.Damage.Value local B=tool.Configurations.ReloadTime.Value local function U(M)local n=game.ReplicatedStorage:FindFirstChild(M)if not n then n=Instance.new("\082\101\109\111\116\101\069\118\101\110\116",game.ReplicatedStorage)n.Name=M end return n end local w=U("\082\079\066\076\079\088\095\082\111\099\107\101\116\085\112\100\097\116\101\069\118\101\110\116")local q=U("\082\079\066\076\079\088\095\082\111\099\107\101\116\069\113\117\105\112\069\118\101\110\116")local C=U("\082\079\066\076\079\088\095\082\111\099\107\101\116\085\110\101\113\117\105\112\069\118\101\110\116")local i=U("\082\079\066\076\079\088\095\082\111\099\107\101\116\070\105\114\101\069\118\101\110\116")w.OnServerEvent:connect(function(M,n,e)local a=M.Character a.Torso.Neck.C0=n;(a.Torso:FindFirstChild("\082\105\103\104\116 \083\104\111\117\108\100\101\114")).C0=e gunWeld=(a:FindFirstChild("\082\105\103\104\116 \065\114\109")):WaitForChild("\082\105\103\104\116\071\114\105\112")end)q.OnServerEvent:connect(function(M)M.Character.Humanoid.AutoRotate=false end)C.OnServerEvent:connect(function(M)M.Character.Humanoid.AutoRotate=true end)
-----------------
--| Constants |--
-----------------

local GRAVITY_ACCELERATION = 196.2

local RELOAD_TIME = tool.Configurations.ReloadTime.Value -- Seconds until tool can be used again
local ROCKET_SPEED = tool.Configurations.RocketSpeed.Value -- Speed of the projectile

local MISSILE_MESH_ID = "http://www.roblox.com/asset/?id=2251534"
local MISSILE_MESH_SCALE = Vector3.new(0.35, 0.35, 0.25)
local ROCKET_PART_SIZE = Vector3.new(1.2, 1.2, 3.27)

local RocketScript = script:WaitForChild("Rocket")
local SwooshSound = script:WaitForChild("Swoosh")
local BoomSound = script:WaitForChild("Boom")

local attackCooldown = tool.Configurations.AttackCooldown.Value
local damage = tool.Configurations.Damage.Value
local reloadTime = tool.Configurations.ReloadTime.Value

local function createEvent(eventName)
	local event = game.ReplicatedStorage:FindFirstChild(eventName)
	if not event then
		event = Instance.new("RemoteEvent", game.ReplicatedStorage)
		event.Name = eventName
	end
	return event
end

local updateEvent = createEvent("ROBLOX_RocketUpdateEvent")
local equipEvent = createEvent("ROBLOX_RocketEquipEvent")
local unequipEvent = createEvent("ROBLOX_RocketUnequipEvent")
local fireEvent = createEvent("ROBLOX_RocketFireEvent")

updateEvent.OnServerEvent:connect(function(player, neckC0, rshoulderC0)
	local character = player.Character
	character.Torso.Neck.C0 = neckC0
	character.Torso:FindFirstChild("Right Shoulder").C0 = rshoulderC0
	gunWeld = character:FindFirstChild("Right Arm"):WaitForChild("RightGrip")
end)

equipEvent.OnServerEvent:connect(function(player)
	player.Character.Humanoid.AutoRotate = false
end)

unequipEvent.OnServerEvent:connect(function(player)
	player.Character.Humanoid.AutoRotate = true
end)
