im working on a tycoon game and for some reason the droppers are spawning before you own the tycoon or anything this is the link if you wanna see the error
https://www.roblox.com/games/214418744/slenderman-tycoon-v-0-0-1-beta
heres the dropper script
wait(2) workspace:WaitForChild("PartStorage") while true do wait(1.5) -- How long in between drops local part = Instance.new("Part",workspace.PartStorage) part.BrickColor=script.Parent.Parent.Parent.DropColor.Value part.Material=script.Parent.Parent.Parent.MaterialValue.Value local cash = Instance.new("IntValue",part) cash.Name = "Cash" cash.Value = 5 -- How much the drops are worth part.CFrame = script.Parent.Drop.CFrame - Vector3.new(0,1.4,0) part.FormFactor = "Custom" part.Size=Vector3.new(1.2, 1.2, 1.2) -- Size of the drops part.TopSurface = "Smooth" part.BottomSurface = "Smooth" game.Debris:AddItem(part,20) -- How long until the drops expire end
I have no script for the button because I have my scripts based off zednovs
I don't use free models, but I'm going to try my best helping u. Make it so when you touch the tycoon gate or whatever to claim it, make a value for that. And put this script in the gate thingy. And in the gate model insert a BoolValue and name the value Owned
local NotTouchedYet = false --debounce function onTouch(hit) if NotTouchedYet == false and hit.Parent:FindFirstChilc("Humanoid") then -- checks if it is a player and the debounce is true local NotTouchedYet = true script.Parent.Owned.Value = true end end
There, now for your script. So this is your final product.
wait(2) workspace:WaitForChild("PartStorage") local GateValue = --go to the place where the Owned value is while GateValue.Value == true and wait(1.5) do --Checks if it is owned and makes the wait here, making the script shorter. local part = Instance.new("Part",workspace.PartStorage) part.BrickColor=script.Parent.Parent.Parent.DropColor.Value part.Material=script.Parent.Parent.Parent.MaterialValue.Value local cash = Instance.new("IntValue",part) cash.Name = "Cash" cash.Value = 5 -- How much the drops are worth part.CFrame = script.Parent.Drop.CFrame - Vector3.new(0,1.4,0) part.FormFactor = "Custom" part.Size=Vector3.new(1.2, 1.2, 1.2) -- Size of the drops part.TopSurface = "Smooth" part.BottomSurface = "Smooth" game.Debris:AddItem(part,20) -- How long until the drops expire end
Also, don't just paste this in and let the magic happen, follow the comments and other instructions!
Is the dropper in the PurchasedObjects model or Objects model it needs to be in one of those. If you would like shoot me a friend request and enable team create.