Hey. I want to change some of my character's properties such as the color and walk speed when I touch a part, but for some reason my script doesn't do it. But instead, if I wanna print something when I touch that part my script prints it. Any ideas why it doesn't work? Script:
local spawnerModel = game.Workspace:WaitForChild("SpawnerModel")
local spawner = spawnerModel:WaitForChild("Spawner")
spawner.Touched:Connect(function(person)
local name = person.Name
local playeroutofeveryone = game.Players:FindFirstChild(name)
if playeroutofeveryone ~= nil then
wait()
local Armor = game.ReplicatedStorage:WaitForChild("Armor")
local Armorholder = Instance.new("Model", person)
Armorholder.Name = "Upgrade"
person.Humanoid.BodyDepthScale.Value = script.DepthScale.Value
person.Humanoid.BodyHeightScale.Value = script.HeightScale.Value
person.Humanoid.BodyWidthScale.Value = script.WidthScale.Value
person.Humanoid.HeadScale.Value = script.HeadScale.Value
person.Shirt.ShirtTemplate = script.Shirt.Value
person.Pants.PantsTemplate = script.Pants.Value
local BodyColors = person:WaitForChild("Body Colors")
BodyColors.HeadColor = BrickColor.new("Black")
BodyColors.LeftArmColor = BrickColor.new("Black")
BodyColors.LeftLegColor = BrickColor.new("Black")
BodyColors.RightArmColor = BrickColor.new("Black")
BodyColors.RightLegColor = BrickColor.new("Black")
BodyColors.TorsoColor = BrickColor.new("Black")
person.Humanoid.WalkSpeed = 20
person.Humanoid.MaxHealth = 1000
person.Humanoid.JumpPower = 100
end
end)

6 comments
You are probably referencing a part not the player humanoid.
Also you should always post error logs when problems like that occur (if you can).
^, "person" is actually a part. You should rename that to part. Then say that person = part.Parent
do person.Parent since the Touched might touch the person's legs.
There is no part called bruceywayne :\ and there are no errors shown in Output.
Thanks ScrewDeath! You're solution fixed the problem! Thanks to everyone else aswell :D