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

How do I move a script into a player if they are on the name list?

Asked by 7 years ago
Edited 7 years ago

I have no clue how to get a script to move into a player when they join if they are on the list.

I have no clue what is wrong with this, so please help. (The script that I need to move into them and execute is a local script, and does not work in workspace, it only works in StarterCharacterScripts, so should I try and do something like script.TheScript.Parent == game.Players.EliteJcoombs.Character?)

game.Players.PlayerAdded:connect(function(player)
    if game.Players.Name == "EliteJcoombs" then
    script.TheScript.Parent = game.Players.EliteJcoombs
    end
end)
0
Please put your code in a codeblock. It's the button with the Lua logo on it. Programical 653 — 7y

1 answer

Log in to vote
0
Answered by 7 years ago

Try making this:

game.Players.PlayerAdded:connect(function()
    local plr = game.Players.LocalPlayer

    --[[
    use this if you want
    its a delay

    wait(0.3)
    ]]--

    local scriptlocation = game.Workspace.Script -- put here the location of your script

    scriptlocation:Clone().Parent = game.Workspace[plr.Name]

end)

I hope this helped (^_^)v

0
I need the script to move into a player so that it runs as if it was in StarterCharacterScripts, thanks. EliteJcoombs 77 — 7y
Ad

Answer this question