generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Why is it giving me this error??

Previous Thread :: Next Thread 
DopeMixtape is not online. DopeMixtape
Joined: 05 Jan 2015
Total Posts: 381
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
DopeMixtape is not online. DopeMixtape
Joined: 05 Jan 2015
Total Posts: 381
18 Aug 2015 04:10 PM
bump?
Report Abuse
DopeMixtape is not online. DopeMixtape
Joined: 05 Jan 2015
Total Posts: 381
18 Aug 2015 05:45 PM
bump2
Report Abuse
morashsPeasant is not online. morashsPeasant
Joined: 06 Jan 2011
Total Posts: 4944
18 Aug 2015 05:47 PM
What line?

while true do the do
Report Abuse
DopeMixtape is not online. DopeMixtape
Joined: 05 Jan 2015
Total Posts: 381
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
morashsPeasant is not online. morashsPeasant
Joined: 06 Jan 2011
Total Posts: 4944
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 is not online. 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
DopeMixtape is not online. DopeMixtape
Joined: 05 Jan 2015
Total Posts: 381
18 Aug 2015 06:37 PM
The error is not making sense. -_-
Report Abuse
DopeMixtape is not online. DopeMixtape
Joined: 05 Jan 2015
Total Posts: 381
18 Aug 2015 07:01 PM
bump3
Report Abuse
Darkenus is not online. Darkenus
Joined: 17 Jul 2014
Total Posts: 1997
18 Aug 2015 07:02 PM
Which line is 102?
Report Abuse
Darkenus is not online. Darkenus
Joined: 17 Jul 2014
Total Posts: 1997
18 Aug 2015 07:03 PM
Nvm I see it
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image