How can I access the player

What do you want to achieve? To access the player from the Server Script

What is the issue? I can’t access the player

I need to access the player for this but I don’t know how please help

Event:FireClient(PlayerHere, firstChosenPlatform, secondChosenPlatform)

What is your script supposed to do? When is the remote supposed to fire?

It supposed to choose two platforms out of three platforms and make them cancollide false

My question was maybe a bit wacky, let me rephrase.

What triggers the script? Does it just fire the remote upon the players joining or leaving, etc?

It fires the remote when a condition is true

Can you show me the script that triggers the remote please?

That’s not the full script

local firstChosenPlatform = GuessPlatforms:GetChildren()[RandomNumber1]
local secondChosenPlatform = GuessPlatforms:GetChildren()[RandomNumber2]

if firstChosenPlatform and secondChosenPlatform then
	firstChosenPlatform.CanCollide = false
	secondChosenPlatform.CanCollide = false
	
	Event:FireClient(firstChosenPlatform, secondChosenPlatform)
end

Do you need the full script? or just that?

The full script please, as it’s kind of complicated to see what you are trying to do with only this.

local GuessPlatforms = script.Parent.Parent:WaitForChild("GuessPlatforms")
local Event = game.ReplicatedStorage:WaitForChild("RemoteEvent")

local randomPlatforms = {}

local function pickRandomPlatforms()
	local RandomNumber1 = math.random(1, #GuessPlatforms:GetChildren())
	local RandomNumber2 = math.random(1, #GuessPlatforms:GetChildren())
	
	while RandomNumber1 == RandomNumber2 do
		if RandomNumber1 ~= RandomNumber2 then
			print("Fixed")
		else
			RandomNumber1 = math.random(1, #GuessPlatforms:GetChildren())
		end
		wait()
	end
	
	return RandomNumber1, RandomNumber2
end

local RandomNumber1, RandomNumber2 = pickRandomPlatforms()

local firstChosenPlatform = GuessPlatforms:GetChildren()[RandomNumber1]
local secondChosenPlatform = GuessPlatforms:GetChildren()[RandomNumber2]

if firstChosenPlatform and secondChosenPlatform then
	firstChosenPlatform.CanCollide = false
	secondChosenPlatform.CanCollide = false
	
	Event:FireClient(firstChosenPlatform, secondChosenPlatform)
end

I just need to access the player for the :FireClient() because it requires the player object

If you paste this script and run a playtest, it’s gonna run the script as soon as you spawn in.

To get the players, you might want to use PlayerAdded.

local GuessPlatforms = script.Parent.Parent:WaitForChild("GuessPlatforms")
local Event = game.ReplicatedStorage:WaitForChild("RemoteEvent")

local randomPlatforms = {}

local function pickRandomPlatforms()
	local RandomNumber1 = math.random(1, #GuessPlatforms:GetChildren())
	local RandomNumber2 = math.random(1, #GuessPlatforms:GetChildren())
 	


 	while RandomNumber1 == RandomNumber2 do
 		if RandomNumber1 ~= RandomNumber2 then
 			print("Fixed")
 		else
 			RandomNumber1 = math.random(1, #GuessPlatforms:GetChildren())
 		end
 		wait()
 	end
 	
 	return RandomNumber1, RandomNumber2
 end
 
 local RandomNumber1, RandomNumber2 = pickRandomPlatforms()
 
 local firstChosenPlatform = GuessPlatforms:GetChildren()[RandomNumber1]
 local secondChosenPlatform = GuessPlatforms:GetChildren()[RandomNumber2]
 
 game.Players.PlayerAdded:Connect(function(player)
     if firstChosenPlatform and secondChosenPlatform then
 	    firstChosenPlatform.CanCollide = false
 	    secondChosenPlatform.CanCollide = false
 	    
 	    Event:FireClient(player, firstChosenPlatform, secondChosenPlatform)
     end
 end)

Re-try again if it didn’t work, I forgot to add the player argument to the FireClient.

Thanks I will try this script o

It worked thanks you some much.

No problem! It’s a pleasure to help.

Make sure to mark the script as the solution so it closes the topic.