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
01 | wait( 2 ) |
02 | workspace:WaitForChild( "PartStorage" ) |
03 |
04 | while true do |
05 | wait( 1.5 ) -- How long in between drops |
06 | local part = Instance.new( "Part" ,workspace.PartStorage) |
07 | part.BrickColor = script.Parent.Parent.Parent.DropColor.Value |
08 | part.Material = script.Parent.Parent.Parent.MaterialValue.Value |
09 | local cash = Instance.new( "IntValue" ,part) |
10 | cash.Name = "Cash" |
11 | cash.Value = 5 -- How much the drops are worth |
12 | part.CFrame = script.Parent.Drop.CFrame - Vector 3. new( 0 , 1.4 , 0 ) |
13 | part.FormFactor = "Custom" |
14 | part.Size = Vector 3. new( 1.2 , 1.2 , 1.2 ) -- Size of the drops |
15 | part.TopSurface = "Smooth" |
16 | part.BottomSurface = "Smooth" |
17 | game.Debris:AddItem(part, 20 ) -- How long until the drops expire |
18 | 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
1 | local NotTouchedYet = false --debounce |
2 | function onTouch(hit) |
3 | if NotTouchedYet = = false and hit.Parent:FindFirstChilc( "Humanoid" ) then -- checks if it is a player and the debounce is true |
4 | local NotTouchedYet = true |
5 | script.Parent.Owned.Value = true |
6 | end |
7 | end |
There, now for your script. So this is your final product.
01 | wait( 2 ) |
02 | workspace:WaitForChild( "PartStorage" ) |
03 | local GateValue = --go to the place where the Owned value is |
04 |
05 | while GateValue.Value = = true and wait( 1.5 ) do --Checks if it is owned and makes the wait here, making the script shorter. |
06 | local part = Instance.new( "Part" ,workspace.PartStorage) |
07 | part.BrickColor = script.Parent.Parent.Parent.DropColor.Value |
08 | part.Material = script.Parent.Parent.Parent.MaterialValue.Value |
09 | local cash = Instance.new( "IntValue" ,part) |
10 | cash.Name = "Cash" |
11 | cash.Value = 5 -- How much the drops are worth |
12 | part.CFrame = script.Parent.Drop.CFrame - Vector 3. new( 0 , 1.4 , 0 ) |
13 | part.FormFactor = "Custom" |
14 | part.Size = Vector 3. new( 1.2 , 1.2 , 1.2 ) -- Size of the drops |
15 | part.TopSurface = "Smooth" |
16 | part.BottomSurface = "Smooth" |
17 | game.Debris:AddItem(part, 20 ) -- How long until the drops expire |
18 | 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.