#Simple script not working.

1 messages · Page 1 of 1 (latest)

maiden surge
#

Here it is. it should make the click sound play whenever a button is clicked. the script is simple and something i used in all other games, but this ones weirdly not working. (inside of StarterPlayerScripts)

for _, v in game.Players.LocalPlayer.PlayerGui:GetDescendants() do
if v:IsA("TextButton") or v:IsA("ImageButton") then
v.MouseButton1Click:Connect(function()
sound:Play()
end)
end
end

glacial geode
#

Youre looping trough all the screenguis

maiden surge
#

is that a problem?

glacial geode
#

Yes cuz you did: v:isa(button) even though v is a screengui

maiden surge
#

its getdescendants

#

are you crazy

glacial geode
#

Oh mb

maiden surge
#

😂 dw

glacial geode
#

Is sound in soundservice?

maiden surge
#

yes

glacial geode
#

Any errors?

maiden surge
#

nope

#

the sound works btw

#

tried with other ways

#

actually lemme debug rq

glacial geode
#

Try adding a print

maiden surge
#

yes

glacial geode
#

Yh

maiden surge
#

wait what the fuck

#

it worked this time i tested

#

LOL

glacial geode
#

Lol

maiden surge
#

it sometimes works sometimes doesnt

#

hmmm

#

the game had a problem with the playergui loading late i think

#

the playergui came like a few secs later than normal

#

lemme add a wait

#

yup after adding a wait

#

it works

vale patio
#

What is ts script

wooden glacier
maiden surge
#

no way yall think im like an incel or sum

wooden glacier
#

naw mate then it works bro😭🤞

maiden surge
#

playergui loaded late

#

no fucking idea why

#

i just added a wait option before the loop

#

so 🤷‍♂️

wooden glacier
#

okay

#

baby juck do dod odoododododo

#

baby juck doododododo odododododod o babyyyy juck dooododododoodod ododod dododo do

#

mama juck dododododo papa juck dodododo

#

brother juck dodododo

vale patio
maiden surge
wooden glacier
#

no way

#

its true...