Song={L,L,L,L,L,L,R,U} --The Array
CS=c.CurrentSong.Value --StringValue
-------------------------------
function SongA1()
CS="Song1"
local S1=script.Song1
S1:Play()
for s=1,8 do
Song[s]()
s=s+1
if s==8 then S1:Stop()elseif
s==7 then wait(0.5) else wait(1)
end end end
LK=c.Lanes.LeftLane("Key"..CS..(CS[s])) --This is where the error arrives
function L()
L1=Instance.new("ImageLabel",c.Lanes.LeftLane)
L1.Size=UDim2.new(1,0 ,0.2,0)
L1.Position=UDim2.new(0, 0,1,0)
L1.Name=("Key"..CS(CS[s])) -- so when L is called , name is supposed to change
L1.ZIndex=2
L1:TweenPosition(UDim2.new(0,0,0.2,0))
end
Error = Players.Player.PlayerGui.LocalPricklyMagpie:127: attempt to concatenate field '?' (a nil value)
I'm trying to make the name of L1 change to Song[s] (the Array). s being 1-8 . There are different Songs such as Song1 Song 2 and Song3, so the first CS is suppose to find which song is being played
function SongA1()
CS="Song1"
starting function SongA1 defines what CS (the String Value) is. so for Song1 it should be ("Key".."Song1"..(CS[s]).The Final CS is suppose to get the current Array number that is being called example Song1[2] That would be "L". So the final name should be ("Key".."Song1".."L") and in the Explorer it should look like "KeySong1L".
--I have been trying to fix it for hours and I've decided to post it on here. Thanks in Advance Novice Scripter(SamDomino)

1 comment
Thank you. I will try to simplify it.