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

Music and values not working in main roblox?

Asked by 5 years ago
Edited 5 years ago

Okay, so I tried to make this Command Bar, where if inserted a specific thing, it will activate a BoolValue placed in lightning that will modify a TextLabel's Text.

Example: I write in this command bar "command_turnon". Bool value in lightning activates. TextLabel's text = "On".

I tried it in Studio with Test function and it worked but in the main game no. Why?

local plr = game.Players.LocalPlayer

local bar = plr.PlayerGui.ControlPanel.Frame.CommandBar

local stuffON = "command.stuffstatus(ON)"

local stuffOFF = "command.stuffstatus(OFF)"



script.Parent.MouseButton1Click:Connect(function()

if bar.Text == stuffON then

game.Lighting.BoolValue.Value = true

end

if bar.Text ==stuffOFF then

game.Lighting.BoolValue.Value = false

end

end)

And the music that is played because of the value of the BoolValue

local playergui = game.Players.LocalPlayer.PlayerGui



while wait(2.7) do

if game.Lighting.BoolValue.Value == true then

playergui.ControlPanel.Frame.Situation.Value.TextLabel.Text = "ON"

playergui.Music:Play()

playergui.Music.Looped = true

end



if game.Lighting.BoolValue.Value == false then

playergui.ControlPanel.Frame.Situation.Value.TextLabel.Text = "OFF"

playergui.Music:Stop()

playergui.Music.Looped = false

end

end

HELP PLEASE!

0
Did you try to enable studio api in your game? enes223 327 — 5y
0
 Yes I enabled it. Fixer1987 95 — 5y

Answer this question