# How to affect a particular player in the island?

**URL:** <https://forums.unrealengine.com/t/how-to-affect-a-particular-player-in-the-island/1311714>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, question, fortnite\
**Created:** [September 25, 2023, 4:24pm UTC](https://forums.unrealengine.com/t/how-to-affect-a-particular-player-in-the-island/1311714 "2023-09-25T16:24:45Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![LyssaSugarNya](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/lyssasugarnya/32/722321_2.png) [@LyssaSugarNya](https://forums.unrealengine.com/u/LyssaSugarNya)\
**Post date:** [September 25, 2023, 4:24pm UTC](https://forums.unrealengine.com/t/how-to-affect-a-particular-player-in-the-island/1311714/1 "2023-09-25T16:24:45Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/3/8/e/38ee2e8310bc6d18bb90bd418a6877f7626683c8.png)  
I know how to affect all the players in island but, let’s say there is 2 players in the island and when a player presses a button, I want the other player’s class to change (even though he didn’t press the button). Is that possible?

---

<div class="post-metadata">

**Author:** ![LoPing](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/loping/32/737300_2.png) [@LoPing](https://forums.unrealengine.com/u/LoPing)\
**Post date:** [September 25, 2023, 7:21pm UTC](https://forums.unrealengine.com/t/how-to-affect-a-particular-player-in-the-island/1311714/2 "2023-09-25T19:21:15Z")

</div>

Sure just modify the players **not** equal to the instigating actor.

It looks like you have a button that affects every other actor? You cannot affect just ONE other actor (unless there are only two) with the info going into the function.

To do that you’d need: **OfferBoonToOtherPlayer(Grantor: actor, Recipient: actor): void**

But if it’s every other actor then what you have going into the function is fine.

---

<div class="post-metadata">

**Author:** ![LyssaSugarNya](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/lyssasugarnya/32/722321_2.png) [@LyssaSugarNya](https://forums.unrealengine.com/u/LyssaSugarNya)\
**Post date:** [September 25, 2023, 9:43pm UTC](https://forums.unrealengine.com/t/how-to-affect-a-particular-player-in-the-island/1311714/3 "2023-09-25T21:43:19Z")

</div>

Thank you for your reply. Yes, only two player is the maximum limit in my island. But, I do have a doubt.  
 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/d/d/5dd60c30541ab89bc3783e750b57fb2b5af142f2.png)  
What should I fill in the place of “actor”?

---

<div class="post-metadata">

**Author:** ![LoPing](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/loping/32/737300_2.png) [@LoPing](https://forums.unrealengine.com/u/LoPing)\
**Post date:** [September 25, 2023, 10:13pm UTC](https://forums.unrealengine.com/t/how-to-affect-a-particular-player-in-the-island/1311714/4 "2023-09-25T22:13:51Z")

</div>

If you have two players only, then one actor in the function just as you set it up originally should work.

The instigating actor is the guy pressing the button, then loop through all the actors and apply your action to everyone BUT the guy pressing the button.

---

<div class="post-metadata">

**Author:** ![LyssaSugarNya](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/lyssasugarnya/32/722321_2.png) [@LyssaSugarNya](https://forums.unrealengine.com/u/LyssaSugarNya)\
**Post date:** [September 25, 2023, 10:21pm UTC](https://forums.unrealengine.com/t/how-to-affect-a-particular-player-in-the-island/1311714/5 "2023-09-25T22:21:46Z")

</div>

I do get the theory behind what you said but I still do not know the code for looping through all the actors without affecting the instigator (I’m still new to verse and coding in general). Thanks to you I atleast theoritically understood how to do this.

---

<div class="post-metadata">

**Author:** ![GraemeBB](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/graemebb/32/1106150_2.png) [@GraemeBB](https://forums.unrealengine.com/u/GraemeBB)\
**Post date:** [September 25, 2023, 10:26pm UTC](https://forums.unrealengine.com/t/how-to-affect-a-particular-player-in-the-island/1311714/6 "2023-09-25T22:26:07Z")

</div>

The Agent object is unique, you could do a comparison between the two

---

<div class="post-metadata">

**Author:** ![LoPing](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/loping/32/737300_2.png) [@LoPing](https://forums.unrealengine.com/u/LoPing)\
**Post date:** [September 25, 2023, 11:25pm UTC](https://forums.unrealengine.com/t/how-to-affect-a-particular-player-in-the-island/1311714/7 "2023-09-25T23:25:55Z")

</div>

The below compiles without issue, but has not been tested…

```auto
     agent_grants_class(Grantor: agent): void =
        for (Recipient : GetPlayspace().GetPlayers()): 
            if (Recipient <> Grantor):
                grant_class_to(Recipient)

     grant_class_to(Recipient: agent): void =
        Print("In 'grant_class_to'")
```

---

<div class="post-metadata">

**Author:** ![LyssaSugarNya](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/lyssasugarnya/32/722321_2.png) [@LyssaSugarNya](https://forums.unrealengine.com/u/LyssaSugarNya)\
**Post date:** [September 26, 2023, 12:43pm UTC](https://forums.unrealengine.com/t/how-to-affect-a-particular-player-in-the-island/1311714/8 "2023-09-26T12:43:15Z")

</div>

Thanks you sm, I really appreciate the fact that you typed all this!  
this really helps me out a lot

---

<div class="post-metadata">

**Author:** ![system](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/1/3/713c9d3f58553f0de89543d76a8a3a2779dc9fa4.png) [@system](https://forums.unrealengine.com/u/system)\
**Post date:** [October 26, 2023, 12:44pm UTC](https://forums.unrealengine.com/t/how-to-affect-a-particular-player-in-the-island/1311714/9 "2023-10-26T12:44:09Z")

</div>

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