Making the serverside script, a module script for my map changing system (basically a serverscript tells this module below to teleport the player to the spawn location of the map and then tell the client to unload all maps and load the current map) and when I check the gravity value which is a num value stored in the map folder it says attempt to index nil with gravity, line 6.
local functions = {
servermapload = function (player, area, spawnname, userespawnpoints, transition,transition_name, transition_description, transition_colour)
local map = workspace.maps:WaitForChild(area)
local gravity = workspace.maps..area.params.gravity.Value -- area is accepting a string and i dont think im concatenating it correctly
local character = player.Character
if userespawnpoints == true then
print ("Using respawn points.")
player:LoadCharacter()
else
local spawns = map.spawns
local character = game.Players.MrGuyROBLOX.Character
local pos = CFrame.new(spawns..spawnname.Value)
local rot = CFrame.Angles(spawns..spawnname.rot.Value)
character.HumanoidRootPart.CFrame = pos * rot
Players.LocalPlayer.Character.Parent = workspace
end
game.ReplicatedStorage.load_client_map:FireClient(area,transition,transition_name, transition_description, transition_colour)
print("Fired client")
end,
}
return functions
map loading test
print ("starting")
functions = require(game.ServerScriptService.server_functions);
functions.servermapload(game.Players.MrGuyROBLOX,"test_map_1","1",false, false, "testmap1", "No description", Color3.new(0.0509804, 0.0509804, 0.0509804))
print("loading map")```