Sound Problem with Zed tycoon kit

Hello Everyone!

I have created tycoon using Zed Tycoon Kit. However, I have already done so many modifications and changes but unforcenetly I could not manage to fix this issue. I found that everyone can hear sound when someone is buying stuff in tycoon.

I think that problem is in this script but i am not 100% sure

> local module = {
> 	['Sounds'] = {
> 		['Purchase'] = Random Music ID, -- The sound that plays when a player buys a button he can afford
> 		['Collect'] = I know it has to be numbers, -- The sound that plays when a player collects his currency
> 		['ErrorBuy'] = Do not worry i am just changing for copyright -- The sound that plays when a player buys a button he can't afford
> 	},
> 	['AutoAssignTeams'] = false, -- If set to false the player will join on a 'hire' team and will pick their own tycoon
> 	['CurrencyName'] = "Cash",-- The name of your currency inside the tycoons; this will show up everywhere.
> 	['BuildAnimation'] = true,
> 	['ButtonsFadeOut'] = true,
> 	['FadeOutTime'] = 0.5,
> 	['ButtonsFadeIn'] = true,
> 	['FadeInTime'] = 0.5,
> 	['LeaderboardSettings'] = {
> 		['KOs'] = true, -- KnockOuts will show on the leaderboard
> 		['KillsName'] = "Kills", -- What will you call the kills
> 		['WOs'] = false,-- Wipeouts will show on the leaderboard
> 		['DeathsName'] = "Deaths", -- What will you call the deaths
> 		['ShowCurrency'] = true, -- Will show player's money to others
> 		['ShowShortCurrency'] = true -- This will change a players cash from showing "100,000" to "100K"
> 	},
> 	['StealSettings'] = {
> 		['Stealing'] = false, -- If this is set to true, you can step on other player's collectors and steal a precent indeciated below from the player!
> 		['StealPrecent'] = 0.25, -- This is the precent of their currency you can take! (1 = all of the currency)
> 		['PlayerProtection'] = 60 -- This is the time in seconds in which the player can not be stolen from
> 	}
> }
> 
> function module:ConvertComma(num)
> 	local x = tostring(num)
> 	if #x>=10 then
> 		local important = (#x-9)
> 		return x:sub(0,(important))..","..x:sub(important+1,important+3)..","..x:sub(important+4,important+6)..","..x:sub(important+7)
> 	elseif #x>= 7 then
> 		local important = (#x-6)
> 		return x:sub(0,(important))..","..x:sub(important+1,important+3)..","..x:sub(important+4)
> 	elseif #x>=4 then
> 		return x:sub(0,(#x-3))..","..x:sub((#x-3)+1)
> 	else
> 		return num
> 	end
> end
> 
> function module:ConvertShort(Filter_Num)
> 	local x = tostring(Filter_Num)
> 	if #x>=10 then
> 		local important = (#x-9)
> 		return x:sub(0,(important)).."."..(x:sub(#x-7,(#x-7))).."B+"
> 	elseif #x>= 7 then
> 		local important = (#x-6)
> 		return x:sub(0,(important)).."."..(x:sub(#x-5,(#x-5))).."M+"
> 	elseif #x>=4 then
> 		return x:sub(0,(#x-3)).."."..(x:sub(#x-2,(#x-2))).."K+"
> 	else
> 		return Filter_Num
> 	end
> end
> 
> return module

I have tried almost everything but nothing seem to work
Could someone please help :slight_smile:
Thanks a lot!

1 Like

Try formatting code when you post to make it easier to debug

I think your main issue is that you are playing sounds on the server, instead when someone buys something fire a remote event from the server to the client after the server confirms they have enough currency to buy it.

On the client side receive that remote event and play the sound from the local script

1 Like

Maybe you read this first: Global Sound Issue

You need to fire a remote to the player that purchased the object. If a server script plays a sound, everyone will hear it.

Example:

local soundPurchaseEvent = game.ReplicatedStorage:WaitForChild('SoundPurchaseEvent')
soundPurchaseEvent:FireClient(playerwhoboughtitem) 

client:

local soundPurchaseEvent = game.ReplicatedStorage:WaitForChild('SoundPurchaseEvent')
soundPurchaseEvent.OnServerEvent:Connect(function()
   local sound = script.PurchaseSound
   sound:Play()
end)

This is exactly what’s in the Post. Please read this before you write exactly the same. Thank you!

Quote it and show it to me, I suggested that the sound should be played on the client rather than the server and as a previous user of Zed’s tycoon kit, all scripts run on the server/workspace, please educate yourself before posting

This it is.
(in the linked post)
I think everyone should read all linked post before writing something, that was said in these linked post.
We should stop this here, this is off-topic and normal things all of us should know.
Thank you.

1 Like

Just did what this person said, I dont see why you have a big problem anyways. But we should stop posting here because this topic is old :+1:

1 Like