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

Why does the part I specifically touched not change to the color red?

Asked by 6 years ago

Why does the part I specifically touched not change to the color red?

part = script.Parent

function ontouched(hit) if game.Player.Name == "phoenix" then part.BrickColor = BrickColor.new("Really Red")

end

end

part.touched:connect(ontouched)

1 answer

Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

first off, you must type in your full name for it to work "phoenix_ruby". Second, game.Player dos not exist. I think you were trying to use this

if hit.Parent.Name == "phoenix_ruby" then
    --do stuff
end
0
Oh. So how do I access a certain player? phoenix_ruby 0 — 6y
0
you can access the player with game.Players:GetPlayerFromCharacter(hit.Parent) with your script Worthy0ne 68 — 6y
Ad

Answer this question