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

How do I parent this script correctly?

I'm trying to get it where this script clones itself and the clone gets parent to workspace but it just wont do any of that

local object = game.ServerStorage["Team change on death"]

local function createScriptCopy()
local ScriptCopy = object:Clone()
game:GetService("Players").PlayerAdded:connect(function(Player)
    Player.Chatted:connect(function(Message)
        if Message == ":Zombies" then
            ScriptCopy.parent = game.Workspace
        end
            
    
    end)
        
end)
    
end

while true do
    createScriptCopy()
    wait(9999999)
end

What am I doing wrong? ;-;

1 answer

✓ Accepted answer

You didn't capitalize 'parent' on line 8.

Fixed script:

local object = game.ServerStorage["Team change on death"]

local function createScriptCopy()
local ScriptCopy = object:Clone()
game:GetService("Players").PlayerAdded:connect(function(Player)
    Player.Chatted:connect(function(Message)
        if Message == ":Zombies" then
            ScriptCopy.Parent = game.Workspace
        end


    end)

end)

end

while true do
    createScriptCopy()
    wait(9999999)
end

2 comments

0

However, I suggest you to not use that while loop if you're going to wait for '9999999' seconds anyway.

0

Ikr. lol.

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