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

How do you make a functional scoreboard for a sports game?

I am working on a new basketball game but I am new to ROBLOX Lua. Can someone give me tips with ROBLOX Lua and/or making a functional scoreboard?

1 answer

✓ Accepted answer

Well, depending on how you script it you could have a central script with some values like

local TeamScore = {
Team1 = 0
Team2 = 0
}

function PointScored(Team, Points)
	local TeamVar = TeamScore[Team]
	TeamVar = TeamVar + tonum(Points)
end

2 comments

0

Where would this script and what values would be needed to make the script work?

0

This script would go wereever you keep your scripts in your game. For example, I like to have one central script inside server script service, and then some module scripts inside a folder called Library. the values are all there. You see kind of new to LUA, so I'd suggest working with simple stuff first.

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