Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

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

2 comments

0

Oh. So how do I access a certain player?

0

you can access the player with game.Players:GetPlayerFromCharacter(hit.Parent) with your script

This discussion is preserved as it was. New answers, comments, and votes are closed.