So, I'm attempting to make a money converter and I'm cloning it into the players money holder on join..
Tree for Money Holder:
Player
-MoneyData
--7 Types of Money
--MoneyConverter Script
Script:
money = script.Parent
m = money:GetChildren()
types = {"Copper", "Iron", "Silver", "Tin", "Gold", "Platinum", "Crystal"}
while wait(0.1) do
print("Converter Start")
for i = 1, #m do
print(i)
print(types[i])
print(money:FindFirstChild(types[i]).Value)
if money:FindFirstChild(types[i]).Value >= 100 then
money:FindFirstChild(types[i]).Value = money:FindFirstChild(types[i]).Value - 100
money:FindFirstChild(types[i+1]).Value = money:FindFirstChild(types[i+1]).Value + 1
end
end
print("Converter End")
end
Cloning into the player:
--MoneyData
banker = script.MoneyConverter
b2 = banker:Clone()
b2.Parent = md
local copper = Instance.new("IntValue", md)
local iron = Instance.new("IntValue", md)
local tin = Instance.new("IntValue", md)
local silver = Instance.new("IntValue", md)
local gold = Instance.new("IntValue", md)
local platinum = Instance.new("IntValue", md)
local crystal = Instance.new("IntValue", md)
local gems = Instance.new("IntValue", md)
copper.Name = "Copper"
iron.Name = "Iron"
silver.Name = "Silver"
tin.Name = "Tin"
gold.Name = "Gold"
platinum.Name = "Platinum"
crystal.Name = "Crystal"
gems.Name = "Gems"
wait(0.5)
b2.Disabled = false
Thing is, the script doesn't want to run in this location.. :( What gives? |