|
game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(msg)
if msg:lower()=="play music" then
m=Instance.new("Message",player.PlayerGui)
wait(0.1)
game.Workspace.Music.Music1:Play()
if msg:lower()=="stop music" then
m=Instance.new("Message",player.PlayerGui)
game.Workspace.Music.Music1:Pause()
end
end
end
idk if ends should be there
this script is to make music play upon command.
thanks for reading,
btw it's so messed up because I edited it.
:-) |
|
ValtameriJoin Date: 2014-03-09 Post Count: 525 |
The ends should look like this
end
end
end)
end) |
|
|
That get's rid of the syntax's, but the music still doesn't play. Here is what it looks like now:
game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(msg)
if msg:lower()=="play music" then
m=Instance.new("Message",player.PlayerGui)
game.Workspace.Music.Music1:Play()
if msg:lower()=="stop music" then
m=Instance.new("Message",player.PlayerGui)
game.Workspace.Music.Music1:Pause()
end
end
end)
end) |
|
|
|
BlupoV2Join Date: 2012-11-12 Post Count: 543 |
One of your end's is in the wrong place. |
|
|
one ur parenthesis is in the wrong place* |
|
|
Okay, what SHOULD it look like? |
|
|
|
|
still not working?
game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(msg)
if msg:lower()=="play music" then
m=Instance.new("Message",player.PlayerGui)
sound:Play()
if msg:lower()=="stop music" then
m=Instance.new("Message",player.PlayerGui)
sound:Pause()
end
end
end)
end) |
|
|
First of all, sound isnt defined and youre not even instancing a new sound, youre instancing a new message. |
|
|
darn, i probably shouldnt try mixing scripts.. i think i can instance sound but what do need to put to define it? |
|
|
sound = Instance.new("Sound") |
|
|
actually idk how to instance it either, the music script i have (just music, no voice commands) has no instance or definitions. |
|
|
fgs, it works BUT it starts when i join the game, the whole aim is to make it play upon someone saying 'play music' |
|
|
Instance.new() creates a new instance, Sound = Instance.new("Sound") defines "Sound" as referring to the actual "Sound" object which is the variables value. |
|
|
Nevermind that, i had a music script on. xD
|
|
|
okay should it be sound = Instance.new("Sound") or Sound = Instance.new("Sound")? |
|
|
It doesnt matter, its just a variable |
|
|
btw i really appreciate you two for helping me, thank you. It still doesn't work though.
game.Players.PlayerAdded:connect(function(player)
player.Chatted:connect(function(msg)
if msg:lower()=="play music" then
sound=Instance.new("Sound")
sound:Play()
if msg:lower()=="stop music" then
sound=Instance.new("Sound")
sound:Pause()
end
end
end)
end) |
|
|
Did you assign a SoundId?. |
|
|
Yep, i inserted it correctly aswell. I've used a music script before, but i'm trying to make one that works upon command. |
|
|
|