Help with event

I have made a little system, whenever a player hits a certain zone (part) the overhead GUI I made will show up with a tag, overall that part works. But I am having issues

The system is based on a remote event, the script inside the part is the following:

player = game.Players.LocalPlayer
script.Parent.Touched:connect(function()
	game:GetService("ReplicatedStorage").KOS:FireServer(player)
end) 

This will fire the event with is located in the RepliactedStorage. inside ServerScriptService

game.ReplicatedStorage.KOS.OnServerEvent:connect(function(Player)
	
		if Player.Character.Rank.VIP.Visible == false then -- VIP won't be able to be KoS
			Player.Character.Rank.KOS.Visible = true -- None VIP's are able to be KoSed

		end
end)

Now there comes the issue the Tag works and all but when it does change the tag it does it for everyone in the server, not just the person who triggered it. How could I make ti so it only changes it for the player who triggered it and not the whole server?

I tried messing around with Player but did not find a way to really fix it as I am a starter into sctripting.

There’s no need to use a remoteevent for this:

--Server script
script.Parent.Touched:connect(function(hit)
	local Player = game.Players:GetPlayerFromCharacter(hit.Parent)
	if Player  then
		if Player.Character then
			if Player.Character.Rank.VIP.Visible == false then -- VIP won't be able to be KoS
				Player.Character.Rank.KOS.Visible = true -- None VIP's are able to be KoSed
			end
		else
			Player.CharacterAdded:Wait()
		end
	end
end) 

Works, also to make it so its a certain group rank it would be something like this?

--Server script
local GroupID = 7840509
script.Parent.Touched:connect(function(hit)
	local Player = game.Players:GetPlayerFromCharacter(hit.Parent)
	if Player  then
		if Player.Character then
			if Player:GetRankInGroup(GroupID) <= 12 then -- VIP won't be able to be KoS
				Player.Character.Rank.KOS.Visible = false -- None VIP's are able to be KoSed
			end
		else
			Player.Character.Rank.KOS.Visible = true 
			Player.CharacterAdded:Wait()
		end
	end
end)

Or am I wrong?

It looks just about right, and if my other post helped you, give a solution to it so others will know this post is solved!

Just tested seems not to work did I do something work?

I’m not too savvy with GetRankInGroup, but you can use GetRoleInGroup

if plr:GetRoleInGroup(7840509) == nameofrole then
   
end

nameofrole being if the my role in the group is “Dev” then you would do

== "Dev"

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