Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

Can Someone Help Me?, I Need Help With The Sounds! (Bad English, Sorry)

Asked by 2 years ago

I'm New At Script But, I Was Making The Gun Script With Youtube Tutorial, And Realized When I Testing Gun With My Friend, I Hear The Shoot Sound, But The Friend Can't Hear The Sound, When Friend Shoot, I Don't Hear It., I Did Disable Some Other Script, But It Doesn't Worked.

01local gun = script.Parent
02local firesound = gun:WaitForChild("Handle").Shoot
03local equipsound = gun.Handle.Equip
04local emptysound = gun.Handle.ClipEmpty
05local reloadsound = gun.Handle.Reload
06local player = game.Players.LocalPlayer
07local clipsize = gun:WaitForChild("Ammo").Value
08local ammo = gun:WaitForChild("Ammo")
09local chara = player.Character or player.CharacterAdded:Wait()
10local hum = chara:WaitForChild("Humanoid")
11 
12local userInput = game:GetService("UserInputService")
13 
14local mouse = game.Players.LocalPlayer:GetMouse()
15 
View all 96 lines...

3 answers

Log in to vote
1
Answered by 2 years ago

I see that it’s in the client. If it’s played in the client, it will only play to the LocalPlayer. Jnstead, Use remote events to send the sound to the server and play it. When the server plays a sound, all players can hear it. You don’t need ti disable other scripts.

1-- In Gun script (Client)
2 
3RemoteEvent:FireServer(Sound)
1-- RemoteEvent Script (Server)
2 
3RemoteEvent.OnServerEvent:Connect(function(Player, Sound)
4   Sound:Play()
5end)

For more info about RemoteEvents, click here.

0
Thanks You For Teaching Me This Kindfully! :D Hiktius 7 — 2y
0
Its better to use a serverscript to handle tools because exploiters can spam the remote unless there is a debounce on the server Kingu_Criminal 205 — 2y
Ad
Log in to vote
0
Answered by 2 years ago

I advise you to use a serverscript to handle your tool instead of a localscript. But as the other answer said, if you are using a localscript then fire a remote to the server telling it to play the sound. If you are looking for scripters, I don't mind helping

0
Don't help him he's kinda gay Wrathoxicihatehim 5 — 2y
0
what do you mean by that lmaooo Kingu_Criminal 205 — 2y
0
that's gay LYESPILLEDINMYEYES -14 — 2y
Log in to vote
0
Answered by 2 years ago

I think you're using a local script, you're going to need a regular script to execute the sounds.

Answer this question