How Do I Make A Loot System?
Asked by
7 years ago Edited 7 years ago
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
2 | local NewLoot = Loot:Clone() |
3 | NewLoot.CFrame = LootBrick.CFrame |
6 | local NewLoot = Loot 1 :Clone() |
7 | NewLoot.CFrame = LootBrick.CFrame |
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!