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

Help fixing this script?

This says "local player is a nil value" so help?

(This script is in serverscriptservice, btw)

local player = game:GetService("Players").LocalPlayer
local character = player.Character


if not (character or character.Parent) then
  character = player.CharacterAdded:wait()
end

if player:FindFirstChild("Class").Value == "Knight" then

delay(1, function()
  player:ClearCharacterAppearance();


  local shirt = Instance.new("Shirt")
  local pants = Instance.new("Pants")

  shirt.ShirtTemplate = "http://www.roblox.com/asset/?id=56815265"
  pants.PantsTemplate = "http://www.roblox.com/asset/?id=164665516"

  shirt.Parent = character
  pants.Parent = character

end)
end



1 answer

Is it a local script? I'm pretty sure that " Local Player" only works inside a local script. That might be whats causing your error.

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