Hello,
im creating a table, and i wanna put something at the end of it, works fine BUT if i remote it with a event, server script for example it says attempt to index number with number? Here is the script.
local CASES = {}
local main = script.Parent.ScrollingFrame
local numberRounds = 0
local numberCost = 0
local gameMode = "1v1v1"
local record = 1
main.IceCase.Button1.MouseButton1Click:Connect(function()
numberRounds = numberRounds +1
numberCost = numberCost +2014
table.insert(CASES, "IceCase")
record = record +1
script.Parent.rounds.Text = "Rounds: "..numberRounds
script.Parent.cost.Text = "Cost: "..numberCost
local org = script.Parent.Parent.CaseInfo.ScrollingFrame.originIMG:Clone()
org.Image = "rbxassetid://10910715327"
org.Parent = script.Parent.Parent.CaseInfo.ScrollingFrame
org.Name = "ClonedIMG"
end)
script.Parent.StartBattle.MouseButton1Click:Connect(function()
if numberCost <= game.Players.LocalPlayer.leaderstats["Trading Bucks"].Value then
game.ReplicatedStorage.caseBattles.createBattle:FireServer(game.Players.LocalPlayer, numberCost, numberRounds, CASES, gameMode)
end
end)
Heres the serverscript, the error is at line 59
local iceCaseIMG = "rbxassetid://10910715327"
replicatedStorage.caseBattles.createBattle.OnServerEvent:Connect(function(Client, Cost, RoundAmount, case)
local newTemp = game.StarterGui.UI.Dashboard.CaseBattles.ScrollingFrame.Template:Clone()
newTemp.Visible = true
newTemp.Name = "Battle"..Client.Name
newTemp.playerName.Text = Client.Name.."'s Case Battle"
newTemp.rounds.Text = tostring(RoundAmount)
newTemp.Button1.itemPrice.priceAmt.Text = tostring(Cost)
if case[1] == "IceCase" then -- ERROR HERE
newTemp.BattlesContainerTemplate.originIMG.Image = iceCaseIMG
end