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

Why wont my Head of Shrek script work :c? [closed]

Asked by
IcyEvil 260 Moderation Voter
9 years ago

Script below

game.Players.LocalPlayers = plr --[[ Output says 23:50:30.251 - LocalPlayers is not a valid member of Players ]]
while true do
plr.Character.Head.Mesh.MeshId = "http://www.roblox.com/asset/?id=19999257"
plr.Character.Head.Mesh.TextureId = "http://www.roblox.com/asset/?id=20001023"
plr.Character.Head.Transparency = "0.25"
end

Locked by adark and evaera

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?

1 answer

Log in to vote
1
Answered by
Gamenew09 180
9 years ago

If you want everyone to have the mesh and texture ID do this:

-- Make sure this goes into a Script, not LocalScript.
while true do
    for _, plr in pairs(game.Players:GetPlayers())do -- foreach loop as it is also called.
        plr.Character.Head.Mesh.MeshId = "http://www.roblox.com/asset/?id=19999257"
        plr.Character.Head.Mesh.TextureId = "http://www.roblox.com/asset/?id=20001023"
        plr.Character.Head.Transparency = "0.25"
    end
    wait() -- ADD THIS! Without this the game will crash.
end

There is no such thing as LocalPlayers in game.Players, and you have to use foreach loop to apply the things to players.

0
I had tried something similar to this, and the game crashed, probably because I forgot the wait() Thanks! IcyEvil 260 — 9y
0
Actually, Game.Players.LocalPlayer (no 's') exists, in LocalScripts. adark 5487 — 9y
Ad