Ok, I am doing a project for a coding class I do which we are learning how to script roblox. I am making a racing game for my project. I want to make it so when the finish part is touched by a red car, a message will say "Red Player has won!" or if it's blue: "Blue Player has won!"
This is what I have so far:
if workspace.EndLine.Touched then
local message = Instance.new("Message")
message.text = "A Player has won!"
wait(4)
message:Destroy()
end
Thank you sweet peeps.
- RGames1234 (happy spooptober)

4 comments
It seems to be conflicting with the rest of my code. ._. These are the two lines conflicting: 'workspace.EndLine.Touched:connect(function(hit)' (Your code) 'function respawnCars()' My car respawning function. Roblox says this is the issue: "11:34:57.481 - ServerScriptService.Script:15: ')' expected (to close '(' at line 3) near 'function'" If you can fix this, you are really cool. Thanks.
Make sure theres a parenthesis after the last end (i.e. "end)" )
Awesome, thanks bro. :P
Even though this is solved, you should use :Connect instead of :connect because :connect is deprecated, so use :Connect.