local Misc = require(game:GetService("ReplicatedStorage").Misc)
script.Parent.MouseButton1Click:Connect(function()
if script.Parent.BackgroundColor3 ~= Color3.fromRGB(255, 17, 86) then
script.Parent.BackgroundColor3 = Color3.fromRGB(255, 17, 86)
script.Parent.UIStroke.Color = Color3.fromRGB(84, 1, 21)
Misc:CurrentTrack():Pause()
else
script.Parent.BackgroundColor3 = Color3.fromRGB(115, 244, 9)
script.Parent.UIStroke.Color = Color3.fromRGB(52, 83, 9)
Misc:CurrentTrack():Play()
end
end)```If I comment out line 1, the color on the button changes but if I don't have it commented out, nothing happens
#Works if I comment out the top line
36 messages · Page 1 of 1 (latest)
any errors in output?
nop
Try :WaitForChild() on misc?
i mean if line 1 is commented how would the line above else work
it would give an error tho
ReplicatedStorage:WaitForChild(“Misc”)
Doesn't change anything
does the currenttrack play anyway?
if yes try commenting the functions for currentrack too
it's probably playing because another script is making it play
that's why
so it does indeed break the code
also why is misc in replicatedstorae
storage
and even then you should just do .ReplicatedStorage and not :GetService("ReplicatedStorage")
replicatedstorage is one of the services that are by default already accessible by the game
there is no error on the first line
i've genuinely tested it out myself
so it's something else
but as i said, everyone one of these services are already accesible by the game
Yeah, I have another script that is playing it
I like to do getService 👍🏼
why
it's like doing 2+2+2+2+2+2+2+2+2+2=20 instead of 2*10=20
Looks more clean in my eyes
this argument is obviously pointless
but you're wasting resources in the long run
its more optimized to just do game.ReplicatedStorage instead of game:GetService("ReplicatedStorage")
plus it's way faster to type as well