How can I fix this?

Hello there,

While I was making the GUI, I found an error with :FireServer(player).

My script is on a LocalScript:

local function start()
	print("startt") -- It prints.
	
	-- [I have disabled this to test if this is the problem ] if PermissionType == 'team' and player.Team == game:GetService('Teams').Host then
	game.ReplicatedStorage.SessionStart:FireServer(player)		
	-- [It's an if statement so disabled the end..] end

	end



	ButtonFrame.Start.MouseButton1Click:Connect(start)

Although the print works, it doesn’t fire the RemoteEvent.

If you know how to fix it please let me know!

Thanks,
@Legend_Pavlos

1 Like

When using FireServer() the player parameter is automatically included, that means you don’t have to enter “player” into the brackets.

1 Like

I removed the player parameter.

local function start()
	print("start") -- It prints.
	
	-- [I have disabled this to test if this is the problem ] if PermissionType == 'team' and player.Team == game:GetService('Teams').Host then
	game.ReplicatedStorage.SessionStart:FireServer()		
print("Did this now starting!")
	-- [It's an if statement so disabled the end..] end

	end



	ButtonFrame.Start.MouseButton1Click:Connect(start)

It still doesn’t work thought!

Is it the other LocalScript that receives the :FireServer().

game.ReplicatedStorage.SessionStart.OnClientEvent:Connect(function(host)

	script.Parent.HostImage.Image = "https://www.roblox.com/headshot-thumbnail/image?userId=".. host.UserId .."&width=420&height=420&format=png"
	local hostusername = host.Name
	local textt = script.Parent.HostImage.loltext

end)

that script that recieves the remote event should be a Script not LocalScript btw. and also u might have to change OnClientEvent to OnServerEvent

1 Like

Thank you for mentioning it out! When I changed it, it worked!

1 Like

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