So I’m making a money drop command for my upcoming game and I’ve encountered an issue.
I say the command drop/money/amount and it is only supposed to drop a single block of money. Instead it does this:
It uses a BindableEvent that upon being Fired drops the money.
My Code [COMMAND SCRIPT]:
game.Players.PlayerAdded:connect(function(plr)
for i = 1, #admins do
plr.Chatted:Connect(function(msg)
if msg:sub(1,11):lower() == 'drop/money/' then
game.ReplicatedStorage.AdminDropMoney:Fire(msg:sub(12))
end
end)
end
end)
My Code [DROP SCRIPT]:
local event = game.ReplicatedStorage.AdminDropMoney
event.Event:connect(function(plr, amt)
local moneyModel = game.ServerStorage:WaitForChild('MoneyModel'):Clone(1)
moneyModel:WaitForChild('Price').Value = amt
moneyModel.MoneyGui.TextLabel.Text = 'Money! Pick it up before anyone else!'
moneyModel.Parent = workspace:WaitForChild('MoneyDrops')
end)