View difference between Paste ID: q6aeirtV and a8deZkQd
SHOW: | | - or go back to the newest paste.
1-
local player = game.Players.LocalPlayer
1+
local player = game.Players.Nuberzzz = game.Players:GetChildren()
2-
p = game.Players:GetChildren()
2+
3
Instance.new("Part",game.Workspace)
4
local Part = game.Workspace.Part
5
6
Part.Anchored = true
7
Part.Size = Vector3(1,1,1)
8
Part.MeshId = ("http://www.roblox.com/Asset/?id=9756362")
9
10
Part = Instance.new("ClickDetector",game.Workspace.Part)
11
12
function onClicked(playerWhoClicked)
13
    for i = 1,#p do
14
    p[i].Character.Head:remove()
15
    end
16
end
17
 
18
script.Parent.ClickDetector.MouseClick:connect(onClicked)
19
20
function onPlayerEntered(player)
21
22
    player.CharacterAdded:connect(function(player) --Anonymous function fired when player's character loads
23
       while wait() do -- Infinite loop!
24
           Part.CFrame = CFrame.new(player.Torso.Position) -- Tele to player's position
25
       end
26
   end)
27
end
28
29
game.Players.PlayerAdded:connect(onPlayerEntered) -- connects function to PlayerAdded event.