What the is problem
The problem is that when I call the Function sendMusicIntro
on myself, it errors, and does not send an Music Intro
, however, I have tried multiple times to fix this, but all attempts failed, and still came back with the same error.
What the Error is saying
The Output keeps returning back;
21:29:49.054 - Workspace.XAdminCommandsX's Admin V1:73: attempt to index local 'plr' (a nil value)
21:29:49.055 - Stack Begin
21:29:49.058 - Script 'Workspace.XAdminCommandsX's Admin V1', Line 73 - global ChkAdmin
21:29:49.059 - Script 'Workspace.XAdminCommandsX's Admin V1', Line 567 - global Chat
21:29:49.065 - Script 'Workspace.XAdminCommandsX's Admin V1', Line 325 - global sendMusicIntro
21:29:49.068 - Script 'Workspace.XAdminCommandsX's Admin V1', Line 563
21:29:49.070 - Stack End
However, I am confused as to why it is doing this, because it is not calling upon a nil
Player.
The code This is the code I have been using:
function sendMusicIntro(plr) print("Music Intro is: ",AdminCommandsSettings['MusicPlayOnEnter']) if AdminCommandsSettings['MusicPlayOnEnter'] then print(plr,plr.Name) print("Audio Playing") Chat("TheeDeathCaster",Prefix.."stopmusic "..plr.Name) Chat("TheeDeathCaster",Prefix.."music "..plr.Name.." "..AdminCommandsSettings['MusicId']) wait(AdminCommandsSettings['AudioDuration']) Chat("TheeDeathCaster",Prefix.."stopmusic "..plr.Name) print("Finished Audio") else print("Music Intro not Activated") end end
If I need to add more information about the code, just let me know and I'll edit my Question. :)