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

How do i put tool giving script for playerPicked?

Asked by 10 years ago

I have tried everything, but my mind is not enough to defeat my script skills. Heres SOME of the script.

                                PlayersInGame = game.Players:GetChildren()
                                        for i = 1, #PlayersInGame do 
                                                PlayersInGame[i].Character:MoveTo(TeleportLocation + Position)
                                    h.Text = "Game in progress [2 Minutes]"
                                    playerPicked=players[math.random(1,#players)]

(Tool giving script here for playerPicked?) (Tool will be in Lightning)

2 answers

Log in to vote
-1
Answered by
KAAK82 16
10 years ago
local Players = game.Players:GetPlayers()
local Object = 'Weapon' --Change it to ur Weapon

PickedPlayer = Players[math.random(1, #Players)]

for i, v in pairs (game.Lighting:GetChildren()) do
if v.Name == Object then
v:clone().Parent = PickedPlayer.Backpack
end
end

PickedPlayer.Character:MoveTo(Position/Part Position)
h = Instance.new('Message')
h.Text = 'Game in Progress [2 Minutes]'

Am just giving Advice on wat the Script would better look like...

Ad
Log in to vote
-1
Answered by 10 years ago

This shall help c;

local PlayerGet = game.Players:GetPlayers() 
local ObjectName = "Speed Coil" --change to object in lighting

for i,v in pairs(PlayerGet) do 
    v.Character:MoveTo(TeleportLocation + Position)
end

h.Text = "Game in progress [2 Minutes]"
game.Lighting[ObjectName]:Clone().Parent = game.Players[tostring(PlayerGet[math.random(1,#PlayerGet)])].Backpack

Answer this question