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

My spawn model script needs a primary part inserted but how where and how?

Asked by 3 years ago
local Summon = game.ServerStorage.Bomb
local otherpart = workspace.Spawner

local function CreateSummonCopy()
    local SummonCopy = Summon:Clone()
    SummonCopy.Parent = game.Workspace
    SummonCopy.Position = otherpart.Position
end

script.Parent.ClickDetector.MouseClick:Connect(function()
    CreateSummonCopy()
end)

The script works if it shall spawn a part the script have a clickdetector that fires when you click the spawn button then from serverstorage it finds something named bomb and takes the bomb to another invisible part named spawner but it only works for part and not models because the script doesnt have a primarypart function how do i add that

0
you can use a mesh on a part MAD_DENISDAILY2 137 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

This may help with the cloning so you can get an idea

local debounce = false

script.Parent.ClickDetector.MouseClick:Connect(function(player)
    if not debounce then
        debounce = true
        player.Character.Humanoid:AddAccessory(game.ServerStorage.accessory:Clone()) -- clone the accessory or it won't be available to others in the game
        wait(1)
        debounce = false
    end
end)

this code clones an accessory from serverStorage and applies it to your character.

Ad

Answer this question