Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

how can i make a dropper drop a roblox model not just a block?

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.

wait(2)
workspace:WaitForChild("PartStorage")


deb = true 
script.Parent.Clicker.ClickDetector.MouseClick:connect(function(wat)
	if deb == true then
		deb = false
			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 = 1 -- How much the drops are worth
			part.CFrame = script.Parent.Drop.CFrame - Vector3.new(0,1.3,0)
			part.FormFactor = "Custom"
			part.Size=Vector3.new(1, 1, 1) -- Size of the drops
			part.TopSurface = "Smooth"
			part.BottomSurface = "Smooth"
			game.Debris:AddItem(part,20) -- How long until the drops expire
			wait(.15)
			deb = true
	end
end)

1 answer

I would recommend putting the model you've made into game.ServerStorage, when you want to use it use the follow code.

local ServerStorage = game.ServerStorage -- Serverstorage
local model = ServerStorage.Model -- Replace with modelname


script.Parent.MouseClick:connect(function()
	local DropClone = model:Clone() -- Clones model
	local Worth = Instance.new("NumberValue", model)-- How much the model is worth.
	Worth.Name = "Worth"
	Worth.Value = 200
	DropClone.Name = "DropC" -- Names model
	DropClone.Parent = workspace -- Puts model in workspace
	DropClone:MoveTo(workspace.Dropper.Position) -- Dropper
end)



-- Endpart

script.Parent.Touched:connect(function(hit)
	local a = hit.Parent:FindFirstChild("Worth")
	hit.Parent:remove()
	-- Now you just gotta add a.Value to your money
end)








If it doesn't work or if you do have questions please ask em!

~ Arthenix

2 comments

0

how would i add the price for each drop when it makes it to the end?

0

Made a endpart script.

This discussion is preserved as it was. New answers, comments, and votes are closed.