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

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

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

1 comment

0

you can use a mesh on a part

1 answer

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.

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