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

How do i make a custom command to start a hockey game?

For example I want it to go through the periods but when the goalie saves it the play is stopped same with the time.

1 answer

Hello, Patriq_Kane!

You can use the event game.Players.PlayerAdded to detect player joining, and then, we use plr.Chatted to detect when he/she sends something on the chat

After that, we can add filters to allowing only some players to use the command, and then test if the message is the same as the command

game.Players.PlayerAdded:Connect(function(plr) -- Detects player joining and stores player object at the var "plr"
	plr.Chatted:Connect(msg) -- Detects when a player chats and stores the message to the var "msg"
		if(msg == "startgame")then -- Checks if what player chatted is the command(in this case, startgame)
			--start the game
		end
	end
end)

If I helped, please accept the answer

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