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

Why doesn't this code work in game, but works in ROBLOX Studio?

Asked by 8 years ago

This code is for a song gui to toggle the song on and off. Please help my problem.

Player = game.Players.LocalPlayer
Button = script.Parent
Song = script.Parent.Parent.Parent.ElevatorMusic
Playing = false

function PlaySong()
    if (Playing == false) then
        Song:Play()
        Playing = true
    elseif (Playing == true) then
        Song:Stop()
        Playing = false
    end
end

Button.MouseButton1Down:connect(PlaySong)
1
Is this a server script, or a local script? M39a9am3R 3210 — 8y

Answer this question