Alright, I made two parts and named them Loot, and Loot1. Then, I put them into the Replicated Storage. I made a part in workspace named LootBox. In the ServerScriptService, I put a Script saying:
local ReplicatedStorage = game.ReplicatedStorage local Loot = ReplicatedStorage:WaitForChild("Loot") local Loot1 = ReplicatedStorage:WaitForChild("Loot1") local LootBrick = workspace:WaitForChild("LootBox")
Loot = 1 Loot1 = 2
random = (math.random(1,2))
while wait(1)do
if random == 1 then
local NewLoot = Loot:Clone()
NewLoot.CFrame = LootBrick.CFrame
end
if random == 2 then
local NewLoot = Loot1:Clone()
NewLoot.CFrame = LootBrick.CFrame
end
end
I need to know how to fix it, it says "15:48:57.473 - ServerScriptService.Script:18: attempt to index local 'Loot1' (a number value)" Thanks!

1 comment
Thanks! I didn't realize my mistake.. Sorry my code was pasted all weird