I'm moving the character in a serverscript, only showing on the client

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I’m making a round based game with maps, and I’ve run into an issue. I’m trying to teleport the character to the map.

  2. What is the issue? Include screenshots / videos if possible!
    HOWEVER, whenever I try to teleport the character in a SERVER SCRIPT, it is apparently only moving the character on the client???

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    No, but i doubt there would be anything there.

Can you show your script(s)? We can’t really help without knowing how your script works…

1 Like

this is my player join/character spawn logic

local function playerSpawn(player)
	player.CharacterAdded:Connect(function(character)
		if currentMap then
			wait(0.1)
			local teleports = currentMap.Teleports:GetChildren()
			local root = character:WaitForChild('HumanoidRootPart')
			root.Position = teleports[math.random(1,#teleports)].Position+Vector3.new(0,2,0)
			local sword = weapons:FindFirstChild("ClassicSword"):Clone()
			sword.Parent = player.Backpack
			local rocketLauncher = weapons:FindFirstChild("RocketLauncher"):Clone()
			rocketLauncher.Parent = player.Backpack
			local ClassicTimebomb = weapons:FindFirstChild("ClassicTimebomb"):Clone()
			ClassicTimebomb.Parent = player.Backpack
			local slingshot = weapons:FindFirstChild("ClassicSlingshot"):Clone()
			slingshot.Parent = player.Backpack
			local superBall = weapons:FindFirstChild("ClassicSuperball"):Clone()
			superBall.Parent = player.Backpack
			local trowel = weapons:FindFirstChild("ClassicTrowel"):Clone()
			trowel.Parent = player.Backpack
		end
	end)
end

game.Players.PlayerAdded:Connect(playerSpawn)

You should show the full script, I can’t see much about the tables/variables, etc.
Also where is the script located?

You want to set root.CFrame instead of root.Position
That line should instead look like

root.CFrame = CFrame.new(teleports[math.random(#teleports)].Position) + Vector3.new(0, 2, 0)
2 Likes
root.Parent:SetPrimaryPartCFrame(CFrame.new(teleports[math.random(#teleports)].Position))

would be even better

1 Like