Not Refering to all Players

It only says intermission for one person, along with that tp’s one person.

local Players = game:GetService("Players")
local player = Players.LocalPlayer
local Controls = require(game.Players.LocalPlayer.PlayerScripts:WaitForChild("PlayerModule")):GetControls()
Controls:Disable()


function beginGame()
	wait(1)
	for i = 15, 0, -1 do 
		wait(1)
		tvalue.Text = "Intermission: " .. i .. "" 
		if i == 0 then
			tvalue.Text = "FIGHT!"
			wait(2)
			Controls:Enable()
			local target = CFrame.new(95.189, 23.25, -43.742)
			for i, player in ipairs(game.Players:GetChildren()) do 
				if player.Character and player.Character:FindFirstChild("HumanoidRootPart") then
					player.Character.HumanoidRootPart.CFrame = target + Vector3.new(0, i * 5, 0)
				end
			for b = 180, 0, -1 do
				wait(1)
				tvalue.Text = "Fight Length: " .. i .. ""
			if b == 0 then
				print("halal mode")

end
		end --Ends
	end
	end
	end
	end

if game.Players.NumPlayers > 1 then --Finding out if there is more than 1 player
	beginGame()
else
	tvalue.Text = "1/2 Players Required.." 
end

Yes, that would make sense. Presumably from line two, this is a LocalScript. LocalScripts cannot change anything directly on the server - including other players and their characters. This is done to deter exploits and for security reasons.

You will need to split this script up into a serverside Script and clientside LocalScript. You can use RemoteEvents to communicate between the server and the client:

Judging from what you have, I would recommend having your core gameplay loop in a Script on the server. In that server script, fire a RemoteEvent to players’ LocalScripts when needed in order to change the timer value and to toggle player controls.

1 Like