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

Help fixing this script?

Asked by 9 years ago

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

Log in to vote
0
Answered by 9 years ago

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.

Ad

Answer this question