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

Why can I not pass my data with a remote event using :FireServer()?

if plr.Finished.Value == true then
				wait(1)
				passedChecks.SendLapTime:FireServer(tonumber(numberText), plr)
				plr.PlayerGui.RaceGui.RaceStopwatch.Visible = false
				break
			end
passedChecks.SendLapTime.OnServerEvent:Connect(function(lapTime, plr)
	print(lapTime)
	plr.RacingStats.LapTime.Value = lapTime

end)

I keep getting an error that says attempt to index number with 'RacingStats'. I don't understand. Please help me.

1 answer

✓ Accepted answer

Player is the first argument for OnServerEvent, not the second.

Because you used it as the second, "plr" is being defined as the lap time and "lapTime" is being defined as the player. You should switch the two because .RacingStats does not exist in a number.

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