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

How to get spawning through a tool to work?

Asked by 3 years ago
Edited by JesseSong 3 years ago

I have been trying to spawn my part through Instance.new with a tool but it justs DOES NOT work no matter how I try. It worked last time but now it doesn't.

Here's the code:

local tool = script.Parent
local handle = tool:WaitForChild("Handle")
local players = game:GetService("Players").PlayerAdded:Wait(20)
local char = players.CharacterAdded:Wait(20)
local head = char.Head

tool.Activated:Connect(function()
    local molotov = Instance.new("Part")
    molotov.Parent = game.Workspace
    molotov.Position = handle.Position
end)
0
Is the part spawning inside the workspace? Soban06 410 — 3y
0
Is this a script or local script? Soban06 410 — 3y
0
yes the part is spawning in workspace and its a script not local script SUPERMEGADANTHEMAN 33 — 3y

1 answer

Log in to vote
0
Answered by 3 years ago

I used remote events to spawn the parts, which is a way better method!

Ad

Answer this question