here is the code im using i just need it to drop a model (to be exact the model i want is https://web.roblox.com/library/22097287/MicroChip ) in roblox other then just a block.
01 | wait( 2 ) |
02 | workspace:WaitForChild( "PartStorage" ) |
03 |
04 |
05 | deb = true |
06 | script.Parent.Clicker.ClickDetector.MouseClick:connect( function (wat) |
07 | if deb = = true then |
08 | deb = false |
09 | local part = Instance.new( "Part" ,workspace.PartStorage) |
10 | part.BrickColor = script.Parent.Parent.Parent.DropColor.Value |
11 | part.Material = script.Parent.Parent.Parent.MaterialValue.Value |
12 | local cash = Instance.new( "IntValue" ,part) |
13 | cash.Name = "Cash" |
14 | cash.Value = 1 -- How much the drops are worth |
15 | part.CFrame = script.Parent.Drop.CFrame - Vector 3. new( 0 , 1.3 , 0 ) |
I would recommend putting the model you've made into game.ServerStorage, when you want to use it use the follow code.
01 | local ServerStorage = game.ServerStorage -- Serverstorage |
02 | local model = ServerStorage.Model -- Replace with modelname |
03 |
04 |
05 | script.Parent.MouseClick:connect( function () |
06 | local DropClone = model:Clone() -- Clones model |
07 | local Worth = Instance.new( "NumberValue" , model) -- How much the model is worth. |
08 | Worth.Name = "Worth" |
09 | Worth.Value = 200 |
10 | DropClone.Name = "DropC" -- Names model |
11 | DropClone.Parent = workspace -- Puts model in workspace |
12 | DropClone:MoveTo(workspace.Dropper.Position) -- Dropper |
13 | end ) |
14 |
15 |
If it doesn't work or if you do have questions please ask em!
~ Arthenix