Why am I getting this error?

Im trying to make a gameplay loop, but Im having a error and Im not sure how to fix it.

  06:20:53.174  ServerScriptService.GameLoop:142: attempt to call a Instance value  -  Server - GameLoop:142
  06:20:53.175  Stack Begin  -  Studio
  06:20:53.175  Script 'ServerScriptService.GameLoop', Line 142  -  Studio - GameLoop:142
  06:20:53.175  Stack End  -  Studio

Im using a remote event called requestChange ( yes I know I can use a string value but I chose not to ), I get the error here

		else
			playerAmount = #Players:GetPlayers()
			if playerAmount == 1 then
				requestChange("No one has won due to having one player in game...")
			end
		end

The remote event usually fires regularly, but Im confused on why Im getting this now even though it usually works.

TL;DR

I believe you forgot :FireAllClients()

else
			playerAmount = #Players:GetPlayers()
			if playerAmount == 1 then
				requestChange:FireAllClients("No one has won due to having one player in game...")
			end
		end

Long explanation, debug your errors

This is the error

attempt to call a Instance value  

This is the line

requestChange("No one has won due to having one player in game...")

Relate the two together

Call is using () to execute a function.

Instance value is the variable “requestChange” which has parenthesis after it, which in this case should be the remote event.

image

2 Likes