I am making this role play game and whoever touches the part first the message pops up on the front. I want it to say the players name instead of the vehcles parts.
local m = Instance.new("Message")
local h = Instance.new("Hint")
value = script.Parent.Value
function onTouch(hit)
value.Value = value.Value + 1
player = hit.Parent.Name
m.Parent = game.Workspace
m.Text = ""..Name.." has won the race!" --Change "has won the quiz" to whatever you want!
wait(3)
m:remove()
h.Parent = game.Workspace
h.Text = "The race has been won "..value.Value.." times!" --Do the same with "The quiz has been won"
wait(4)
h:remove()
end
script.Parent.Touched:connect(onTouch)
I want the players name to be said. Not the part.

1 comment
remove() is deprecated, user Destroy() instead.