What do you want to Know Or Solve?

I want to solve and figure out why its not working properly.

What do you know about this Topic?

I do not know alot about this, only the basics. I have visited a looked for this topic.

Normal Script Inside Of Folder in a Region Of Parts.

local RegionName = "Plains"
local Region1 = game.Workspace.Regions:FindFirstChild(RegionName)
local event = game.ReplicatedStorage.Events.Location

for i,v in pairs(Region1:GetChildren()) do
	v.Touched:Connect(function(hit)
		local tagPlayer = game.Players:GetPlayerFromCharacter(hit.Parent)
		if tagPlayer then
			event:FireClient(tagPlayer)
		end
	end)
end

Local Script In StarterGui

local event = game.ReplicatedStorage.Events.Location
local localplayer = game.Players.LocalPlayer

event.OnClientEvent:Connect(function(player)
	if player == localplayer then
		print("Success")
	else
		print("Failure") --It keeps printing Failure yet I'm the only one touching the part.
	end	
end)

6 comments

0

You're not passing any arguments into :FireClient. That method of RemoteEvent requires you to specify the Player (connected Client) in which you're invoking the event on. You've successfully done so by passing the Player as the first argument, but failed to give the following details (likely the same argument)

0

You wouldn't need to affirm the Player either way, as you're already firing to the intended Client.

0

But then if its going to the intended client, how would I know which player GUI to change the location of. (which is what the print is for)

0

And How would I add the Same Argument? Add the same values in there? FireServer(tagPlayer, tagPlayer)? I cant put the name in because thats an object value

0

Ok i see what your saying now i made some changes but i need to access their player GUI. When I do that there is an error saying indexing nil with Player.PlayerGui

0

Nvm i just used Local PLayer