✓ Accepted answer
This is a better method, it's usually assumed if you desire to change the body colours of a Character, you work with the Characters BodyParts directly. It would look somewhat like so
Also if we're dealing with Server Passed Events, then we know that an argument will be passed along from the ClientFired giving us their PlayerObject, remember though the Player is always the first argument passed, don't confuse it for another, never forget to reference it.
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local RemoteEvent = ReplicatedStorage:WaitForChild("RemoteEvent")
RemoteEvent.OnServerEvent:Connect(function(Player)
local Character = Player.Character
if (Character ~= nil) then
local BodyParts = {}
for _,BodyPart in ipairs(Character:GetChildren())
if (BodyPart:IsA("BasePart")) then
table.insert(BodyParts, BodyPart)
end
end
for i = 1,#BodyParts do
BodyParts[i].BrickColor = BrickColor.new("Really black")
end
end
end)
There are definitely different, maybe even simpler ways, but this is the method I know, so I hope this helps you out, Good Luck!
4 comments
you should work on changing the properties of the bodycolor inside someones character, either that or parent it under a character
local BodyColors = Instance.new("BodyColors") will never be nil.
It could be, someone can easily destroy an instance these days
unless Instance.new somehow malfunctions which would never happen