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

Why does my part spawning part not working? Pls Help!

Asked by 2 years ago
local spawnpoint = script.Parent.TargetPart
local cooldown = false

script.Parent.Activated:Connect(function()
    if cooldown == false then
        cooldown = true
        local clone = game.ServerStorage.FinishedWeapons.Lvl1lazer.Ammo:Clone()
        local cf = spawnpoint.CFrame
        clone:SetPrimaryPartCFrame(cf)
        clone.Parent = game.Workspace
        wait(1)
        cooldown = false
    end
end)
0
how is this script being activated?? theking66hayday 841 — 2y
0
i click the tool and it spawns a part from the severstorage xGlacier101x 9 — 2y

1 answer

Log in to vote
0
Answered by 2 years ago

If the script is a localScript, then you'll need to move the object from ServerStorage to ReplicatedStorage, you can't access ServerStorage from the client.

Ad

Answer this question