|
| 18 Aug 2015 03:46 PM |
All you need to know is that "Mixtape" is a dictionary and that the error is "ServerScriptService.Mixtape.MixtapeDictionary:102: attempt to index a nil value":
function getSongInfo(tab) local t = {} for i,v in pairs(tab) do table.insert(t,#t,i) end return t end
local getSong = getSongInfo(Mixtape)
script.GetSongName.OnInvoke = function() return Mixtape[getSong[randomSong]].SongName end
script.GetLastSong.OnInvoke = function() local lastSong = script.GetSongName:Invoke() return game.Workspace:FindFirstChild(lastSong).Name end
script.GetSongId.OnInvoke = function() return Mixtape[getSong[randomSong]].SongId end
script.NextSong.OnInvoke = function() local getLastSong if not game.Workspace:FindFirstChild("Song") then randomSong = math.random(1,20) getLastSong = script.GetLastSong:Invoke() else randomSong = math.random(1,20) end local songName = script.GetSongName:Invoke() if game.Workspace:FindFirstChild("Song") then game.Workspace:FindFirstChild("Song").Name = songName else game.Workspace:FindFirstChild(getLastSong).Name = songName end local songId = script.GetSongId:Invoke() game.Workspace[songName].SoundId = "rbxassetid://"..songId print("Ready") repeat wait() until game.Workspace[songName].TimeLength ~= 0 print("Set") game.Workspace[songName]:Play() print("Go") end |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 18 Aug 2015 05:47 PM |
What line?
while true do the do |
|
|
| Report Abuse |
|
|
|
| 18 Aug 2015 05:49 PM |
script.GetLastSong.OnInvoke = function() local lastSong = script.GetSongName:Invoke() return game.Workspace:FindFirstChild(lastSong).Name --This line end |
|
|
| Report Abuse |
|
|
|
| 18 Aug 2015 06:00 PM |
Add a quick check to see if it exists??? if game.Workspace:FindFirstChild(lastSong) then return game.Workspace:FindFirstChild(lastSong).Name end
while true do the do |
|
|
| Report Abuse |
|
|
tecno15
|
  |
| Joined: 10 Sep 2009 |
| Total Posts: 1372 |
|
|
| 18 Aug 2015 06:11 PM |
| maybe look at the error instead of copy/pasting the entire code to have us fix your syntax error |
|
|
| Report Abuse |
|
|
|
| 18 Aug 2015 06:37 PM |
| The error is not making sense. -_- |
|
|
| Report Abuse |
|
|
| |
|
Darkenus
|
  |
| Joined: 17 Jul 2014 |
| Total Posts: 1997 |
|
| |
|
Darkenus
|
  |
| Joined: 17 Jul 2014 |
| Total Posts: 1997 |
|
| |
|