So sometimes in my game which is the dropper simulator it sometimes gives the player the int limit for some reason and i do not want it to do that.
The only things that Gives the player cash is just the collector which just gives the player cash over the block attributes heres the collector script.
local players = game:GetService("Players")
script.Parent.Touched:Connect(function(hit)
if hit:GetAttribute("CashToGive") then
local plot = script.Parent.Parent.Parent.Parent
if not plot then warn('No Plot') return end
hit:Destroy()
local PlotUSERID = script.Parent.Parent.Parent.Parent:FindFirstChild("UserID").Value
local player = players:GetPlayerByUserId(PlotUSERID)
player.leaderstats.Cash.Value += hit:GetAttribute('CashToGive')
if not PlotUSERID then return end
end
end)
I think its because its exausted for some reason but the dropper script is here aswell
local Block = game:GetService("ServerStorage"):WaitForChild("Blocks").DarkBlock
while task.wait(1) do
local newpart = Block:Clone()
newpart.CFrame = script.Parent.CFrame - Vector3.new(0,2,0)
newpart:SetAttribute("CashToGive",script.Parent.Parent:GetAttribute("CPS"))
newpart.Parent = script.Parent.Parent.DropperParts
end