Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Won't work in localscript?

I know this script isn't the most efficient, but i'm having troubles with it. I want to click a button and make fog go to 0 and play a thump noise got that done. It just won't work in local script that makes it so it will only happen to the person that presses it. It's either a simple mistake or the whole 9 yards. Thanks for helping!

local sound = script.Parent.Sound
local sound1 = script.Parent.Thump


function playsound()
	sound:Play()
	game.Ambient.FogEnd = 0
	sound1:Play()
	wait(1)
	sound1:Play()
	wait(1)
	sound1:Play()
	wait(1)
	sound1:Play()
	wait(1)
	sound1:Play()
	wait(1)
	sound1:Play()
	wait(1)
	sound1:Play()
	wait(1)
	sound1:Play()
	wait(1)
	sound1:Play()
	wait(1)
	sound1:Play()
	wait(1)
	sound1:Play()
	wait(1)
	sound1:Play()
	wait(1)
	sound1:Play()
	wait(1)
	sound1:Play()
	wait(2)
	sound1:Play()
	wait(3)
	game.Ambient.FogEnd = 50
end

script.Parent.ClickDetector.MouseClick:connect(playsound)

5 comments

0

First in line 08 you started playing the Song, Once it plays it Plays, you don't need multiple plays.

0

I know but I want multiple thumps

0

You just explained what you were using, and that is your problem; you are using a 'LocalScript', and you are attempting to use a 'LocalScript' like a 'Script'-Script, 'LocalScript''s only working within a Player's Character, or in their 'PlayerGui', they aren't supported in the Workspace itself, use a regular 'Script' instead [Server-Sided]', also lines 8-36, that many lines are not necessary, con

0

*Consider using a 'for' loop? Also, just pointing out mistakes and errors, sorry if I sound harsh.

0

Use a Regular Script for ClickDetector.

1 answer

This discussion is preserved as it was. New answers, comments, and votes are closed.