Get Var from Server as Client

I’m trying to run a module script from the client in order to get a value from a module script, however the value keeps coming up as nil when ran from the client side, but has a value when ran from server side.

How do I get the value from the server to the client?

local playerSpots = {
	spots = {}
}

playerSpots.GetSpot = function(spot)
	return playerSpots.spots[spot]
end

return playerSpots
function()
	print(playerSpots.GetSpot(1))
	if (player == playerSpots.GetSpot(1)) then
		print("Success")
	else
		print("Fail")
	end

image

ModuleScripts can’t communicate between the client and the server. You will instead need to use RemoteEvents

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.