I have problem with implementing Sound.RollOffMinDistance on Tycoon Kit made by Twins

I was testing/learning this Tycoon Kit made by “Twins” Twin's Tycoon Kit - Roblox . And tried it with a friend. the biggest complaint from my friend was that the sound coming from my purchasing, collecting and etc. can be heard from far away.

So I did some digging and found Sound | Documentation - Roblox Creator Hub. What I did based on this was to add any Sound in the script with .RollOffMinDistance. Example: Sound.RollOffMinFistance(script.Parent.Essentials, Settings.Sounds.Collect) but then, after running the game, I was not able to collect the money from the collector so couldn’t test the sound… I’m new to this, sorry if the solution is actually basic knowledge

This is the original code I assume the setting for the sound and etc. (untouched version).

deb = false
	script.Parent.Essentials.Giver.Touched:connect(function(hit)
		local player = game.Players:GetPlayerFromCharacter(hit.Parent)
		if player ~= nil then
			if script.Parent.Owner.Value == player then
				if hit.Parent:FindFirstChild("Humanoid") then
					if hit.Parent.Humanoid.Health > 0 then
						if deb == false then
							deb = true
							script.Parent.Essentials.Giver.BrickColor = BrickColor.new("Bright red")
							local Stats = game.ServerStorage.PlayerMoney:FindFirstChild(player.Name)
							if Stats ~= nil then 
							Sound(script.Parent.Essentials, Settings.Sounds.Collect)
							Stats.Value = Stats.Value + Money.Value
							Money.Value = 0
							wait(1)
							script.Parent.Essentials.Giver.BrickColor = BrickColor.new("Sea green")
							deb = false
							end
						end
					end
				end
			elseif Stealing.Stealing then -- if player isn't owner and stealing is on
				if CanSteal == true then
					CanSteal = false
					delay(Stealing.PlayerProtection, function()
						CanSteal = true
					end)
					if hit.Parent:FindFirstChild("Humanoid") then
						if hit.Parent.Humanoid.Health > 0 then
							local Stats = game.ServerStorage.PlayerMoney:FindFirstChild(player.Name)
							if Stats ~= nil then
								local Difference = math.floor(Money.Value * Stealing.StealPrecent)
							Sound(script.Parent.Essentials, Settings.Sounds.Collect)
								Stats.Value = Stats.Value + Difference
								Money.Value = Money.Value - Difference
							end
						end
					end
				else
				Sound(script.Parent.Essentials, Settings.Sounds.Error)
				end
			end
		end
	end)
1 Like

Just go on settings and delete the sound part on the script or replace the ID to 0

But I want to sound though, just don’t want the sound to be able to be heard from for other players far away… based on distance

Yes so this is a problem you are right, I need to work on changing the sound distance. When I recently got this tycoon from Zednov of course, I never fixed the problem. Ill look into it.

Heres an updated KIT, btw : Twins Tycoon Kit 2.0 - Roblox

1 Like

Yea i have seen the updated kit. the reason why I didnt went for that was due to the “auto-save” but based on how easy it was to modify the old tycoon kit, there will be a setting to disable it right?

Thank you for replying, Twin

Well ya you can just disable Auto-Save. Also if you just want building animations look at the video you can just put it into the purchase handler.