Hello devs, so im making a rythm game and i have a script error. it says Megolovania - Sans is not a valid member of Folder "ReplicatedStorage.SongMaps"
the script is located in a starter gui with a screengui called “GameGui” and under the screengui there is a frame called “MainFrame” and then there is a local script located there can anyone help?
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local PlayEvent = ReplicatedStorage:WaitForChild("PlayEvent")
local SongMaps = ReplicatedStorage:WaitForChild("SongMaps")
local UserInputService = game:GetService("UserInputService")
local RunService = game:GetService("RunService")
local PlayFrame = script.Parent:WaitForChild("PlayFrame")
local Buttons = PlayFrame:WaitForChild("Buttons")
local CurrentNotes = PlayFrame:WaitForChild("CurrentNotes")
local OriginalColors = script.Parent:WaitForChild("OriginalColors")
local ChangedColors = script.Parent:WaitForChild("ChangedColors")
local KeyBinds = {"A", "S", "D", "F"}
local KeyHolds = {}
local Paths = {}
for _, k in ipairs(KeyBinds) do
Paths[k] = {}
KeyHolds[k] = false
end
local function wait(Amount)
local Second = tick()
while tick() - Second < Amount do
RunService.Stepped:Wait()
end
end
local function CreateNote(Key, CurrentSongSpeed)
local ClonedNote = Buttons[Key]:Clone()
ClonedNote.Parent = CurrentNotes
ClonedNote.Image = "rbxassetid://"..ChangedColors[Key].Value
ClonedNote.Position = Buttons[Key].Position + UDim2.new(0, 0, 1.2, 0)
ClonedNote:TweenPosition(Buttons[Key].Position + UDim2.new(0, 0, -1, 0), "Out", "Linear", CurrentSongSpeed, false)
Paths[Key][ClonedNote] = "Tweening"
coroutine.resume(coroutine.create(function()
wait(CurrentSongSpeed)
ClonedNote:Destroy()
Paths[Key][ClonedNote] = nil
end))
end
PlayEvent.OnClientEvent:Connect(function(SongName)
script.Parent.Parent.Enabled = true
local CurrentSong = require(SongMaps[SongName])
local CurrentSongSpeed = SongMaps[SongName].CurrentNoteSpeed.Value
for i = 1, #CurrentSong do
wait(CurrentSong[i].Time)
CreateNote(CurrentSong[i].Key, CurrentSongSpeed)
end
coroutine.resume(coroutine.create(function()
workspace.Songs[SongName].Ended:Wait()
script.Parent.Parent.Enabled = false
end))
end)
local function UpdateKeybind(Type, InputKey, GameProcessed)
if GameProcessed then return end
local InputLetter = tostring(InputKey.KeyCode):split(".")[3]
if not table.find(KeyBinds, InputLetter) then return end
KeyHolds[InputLetter] = Type
local ChosenPath = Paths[InputLetter]
if not ChosenPath then return end
local GuiObject = Buttons[InputLetter]
if not GuiObject then return print("Error: Unable to locate keybind.") end
if Type == false then return end
for Object, Action in pairs(Paths[InputLetter]) do
if math.abs(GuiObject.Position.Y.Scale - Object.Position.Y.Scale) < 0.1 then
Object:Destroy()
break
end
end
end
UserInputService.InputBegan:Connect(function(...)
UpdateKeybind(true, ...)
end)
UserInputService.InputEnded:Connect(function(...)
UpdateKeybind(false, ...)
end)
RunService.RenderStepped:Connect(function()
for Letter, Toggle in pairs(KeyHolds) do
local GuiObject = Buttons[Letter]
if not GuiObject then return print("Error: Unable to find keybind.") end
if Toggle == true then
GuiObject.Image = "rbxassetid://"..ChangedColors[Letter].Value
else
GuiObject.Image = "rbxassetid://"..OriginalColors[Letter].Value
end
end
end)
also this error is about a folder in rep storage called “SongMap” with a module script under it and a number value under that named “CurrentSongSpeed” please help
EDIT
im not getting the error anymore but the ui wont go on the screen when i start the song, if you need a photo of my explor bar ill be happy to put one, i need help. I FIXED IT!!!