Skip to content
This repository has been archived by the owner on Jun 11, 2020. It is now read-only.

Boombox 3.0 now keeps playing when dropped #6

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions Items/Gear/193769809.rbxmx
Original file line number Diff line number Diff line change
Expand Up @@ -262,9 +262,24 @@ local Tool = script.Parent
local Handle = Tool:WaitForChild("Handle")
local Remote = Tool:WaitForChild("Remote")
local Sound = Handle:WaitForChild("Sound")
local Debris = game:GetService("Debris")

function onEquip()
	local Gyro = Handle:FindFirstChild("FallRight")
	if Gyro then
		Gyro:Destroy()
	end
end

function onUnequip()
	Sound:Stop()
	if Tool.Parent:IsA("Backpack") then
		Sound:Stop()
	elseif not getPlayer() then
		local Gyro = Instance.new("BodyGyro")
		Gyro.Name = "FallRight"
		Gyro.Parent = Handle
		Debris:AddItem(Gyro, 3)
	end
end

function onActivate()
Expand Down Expand Up @@ -303,7 +318,8 @@ function onRemote(player, func, ...)
end

Remote.OnServerEvent:connect(onRemote)
Tool.Unequipped:connect(onUnequip)</ProtectedString>
Tool.Unequipped:connect(onUnequip)
Tool.Equipped:connect(onEquip)</ProtectedString>
</Properties>
</Item>
<Item class="Camera" referent="RBXF7EFD1B9DCFF4C3A8A5C76E90B650138">
Expand Down