Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Hi, I want to drop a Union. How to do that? I got some scripts for it.

Asked by 9 years ago
local CrateCreater = game.Workspace.ScriptTest.ScriptTest


function CreateCrate()

    for _, object in pairs(game.Workspace:GetChildren()) do
        local CrateCopy =  game.ServerStorage.CrateToDrop:Clone()
        CrateCopy.Parent = game.Workspace.PartStorage
    end
end

CrateCreater.Touched:connect(CreateCrate)

while wait(1) do
    CreateCrate()

end

Here is my script. Right now I want to say: "Hey you! you have to spawn there (x,y,z) How to do that? I'm making a tycoon with the berezaa tycoon-pack. this is his dropper script:

wait(2)
workspace:WaitForChild("PartStorage")
while true do
    wait(1) -- How long in between drops
    local part = Instance.new("Part",workspace.PartStorage)
    part.BrickColor=script.Parent.Parent.Parent.DropColor.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,0)
    part.Size=Vector3.new(1,1,1) -- Size of the drops
    game.Debris:AddItem(part,20) -- How long until the drops expire
end

So, my big question is: How to drop the union I made instead of the stupid (1,1,1) sized brick?

1 answer

Log in to vote
1
Answered by 9 years ago
wait(2)
while true do
    wait(1) -- How long in between drops
    local part = union --a reference to your union
    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,0)
    game.Debris:AddItem(part,20) -- How long until the drops expire
end

That won't clone your union, it'll just drop it in. If you want to clone it, reference your union and stick :Clone() on the end, then parent the clone to the workspace at the end of the script.

0
no problem aquathorn321 858 — 9y
Ad

Answer this question