Hello, I ran into a problem where I run a function and it checks what world I am in and it prints a certain number. Here is the script, any help is appreciated.
local function getData(Worlds)
local fVar = ""
local Data = {
["1"] = "2500", -- ["1"] Number of World | "2500" Number that should be printed out.
["2"] = "13500",
}
if Worlds == 1 then
fVar = Data["1"]
end
if Worlds == 2 then
fVar = Data["2"]
end
return(fVar)
end
local function boughtMap()
print(getData(Player:WaitForChild("MapWorld").Value))
end
--// Connect Functions
purchaseUI.ConfirmUI.Buy.MouseButton1Click:Connect(boughtMap)
Ah I found the solution, the value was a string value. In my IF statement, I referred it to an integer so the script must have gotten confused and came out with nil.