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

im trying to make it where if the scp isnt already spawned into workspace it will ?

Asked by 7 years ago
local S049 = game.ServerStorage["SCP-049"]

function spawnS049()
    if game.workspace:FindFirstChild(S049) == false then
        S049 = game.Workspace
    end
    end
spawnS049()
0
Please clarify on what the issue is? Brinceous 85 — 7y
0
sorry, so its supposed to transfer to workspace to become physical and its just well not macabe55101 38 — 7y
0
you're missing "Parent" on line 5 RobloxianDestory 262 — 7y
0
oh lemme try that! macabe55101 38 — 7y
View all comments (2 more)
0
like S049.Parent? macabe55101 38 — 7y
0
yea RobloxianDestory 262 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago
local SCP = game.ServerStorage:FindFirstChild("SCP-049") -- declares the variable as the SCP model

function spawnSCP()
    if game.Workspace:FindFirstChild("SCP-049") == nil then -- if it doesn't exist then
        SCP:Clone().Parent = workspace -- clone it and set it's parent to workspace
    end
end

spawnSCP()
0
couldnt I just set it as a clone on line 1? local S049 = game.ServerStorage["SCP-049"]:Clone() macabe55101 38 — 7y
0
Yes, you could. I hadn't because there's a chance you may use the SCP in ServerStorage for something other than cloning. Brinceous 85 — 7y
1
If this is what you're looking for, please accept the answer and mark as solved to help people with a similar situation in the future. Brinceous 85 — 7y
Ad

Answer this question