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)
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)
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
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
Oh. So how do I access a certain player?
you can access the player with game.Players:GetPlayerFromCharacter(hit.Parent) with your script