I need help with making a script for my game

So I was playing Roblox and randomly came upon this game where you test your obby speed, and I thought to myself, “Hmm… Should I make something like this?” And, well, yeah I tried.

So I started out by trying to make a player.Chatted function and (ok so just to make it clear, i have no experience with lua so i just did what came up to my mind) and here is how it went:

game.Players.PlayerAdded:Connect(function(player)
	player.Chatted:Connect(function(msg)
		local isRound = false
		if msg == "yes"	then
			player.Character.HumanoidRootPart.CFrame = CFrame.new(439.4, 6, 32.1)
			wait(3)
			game.Workspace.startPart.BillboardGui.TextLabel.Text = "3"
			wait(1)
			game.Workspace.startPart.BillboardGui.TextLabel.Text = "2"
			wait(1)
			game.Workspace.startPart.BillboardGui.TextLabel.Text = "1"
			wait(1)
			game.Workspace.startPart.BillboardGui.TextLabel.Text = "GO"
			wait(0.5)
			isRound = true
			game.Workspace.startPart.BillboardGui.TextLabel.Text = game.Workspace.startPart.BillboardGui.TextLabel.IntValue
			------------------------------------------------------------------------------------------------------------------------------
			if isRound == true then
-- ignore this part, i will work on it as soon as i can
		end
	end
end)

If I made a million mistakes here, I wouldn’t blame myself.

But how can I fix this?

One mistake i found is when doing cframes, they take in way more than three values so you have to use math.rad() on each of your value

Also, you put the variable isRound in the function chatting so isRound will always be false.

Another thing is, use string.sub(“yes”, 1, 3)

Finally, IntValue should be IntValue.Value

1 Like