# Scoring system problem

**URL:** <https://forums.unrealengine.com/t/scoring-system-problem/837232>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, question, fortnite\
**Created:** [April 1, 2023, 1:32pm UTC](https://forums.unrealengine.com/t/scoring-system-problem/837232 "2023-04-01T13:32:09Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Qwaxi34](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Qwaxi34](https://forums.unrealengine.com/u/Qwaxi34)\
**Post date:** [April 1, 2023, 1:32pm UTC](https://forums.unrealengine.com/t/scoring-system-problem/837232/1 "2023-04-01T13:32:09Z")

</div>

I am trying to create scoring system for eliminations.  
I ran into problem while having to call my method “IncreasePlayerScore”.  
The problem is “This function parameter expects a value of type tuple(agent,int), but this argument is an incompatible value of type tuple(?agent,int).”,  
I guess I should cast ?agent to agent.  
How can I do it?

---

<div class="post-metadata">

**Author:** ![Cray\_Opeta](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/cray_opeta/32/637656_2.png) [@Cray\_Opeta](https://forums.unrealengine.com/u/Cray_Opeta)\
**Post date:** [April 1, 2023, 2:19pm UTC](https://forums.unrealengine.com/t/scoring-system-problem/837232/2 "2023-04-01T14:19:15Z")

</div>

Can you show us your code?

---

<div class="post-metadata">

**Author:** ![Qwaxi34](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Qwaxi34](https://forums.unrealengine.com/u/Qwaxi34)\
**Post date:** [April 3, 2023, 9:21pm UTC](https://forums.unrealengine.com/t/scoring-system-problem/837232/3 "2023-04-03T21:21:02Z")

</div>

Here is the code

 ![Screenshot 2023-04-04 002044](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/c/f/dcfa04d504f2eaa321121827c1504a71cd25cd7c.png)

---

<div class="post-metadata">

**Author:** ![Xaert1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Xaert1](https://forums.unrealengine.com/u/Xaert1)\
**Post date:** [April 3, 2023, 9:39pm UTC](https://forums.unrealengine.com/t/scoring-system-problem/837232/4 "2023-04-03T21:39:52Z")

</div>

I’m pretty sure you can do this by storing the ?agent in an agent during an if-statement, since that’s a failure context.

Something like:

```auto
if ( MyAgent := Agent? ):
    IncreasePlayerScore(MyAgent, EliminationScore)

```

It basically fails if Agent is null, and skips the function call. If it succeeds, it calls it with a non-nullable variable type.

---

<div class="post-metadata">

**Author:** ![Qwaxi34](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Qwaxi34](https://forums.unrealengine.com/u/Qwaxi34)\
**Post date:** [April 3, 2023, 10:45pm UTC](https://forums.unrealengine.com/t/scoring-system-problem/837232/5 "2023-04-03T22:45:14Z")

</div>

Not working

---

<div class="post-metadata">

**Author:** ![IKnowYouKnow1](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@IKnowYouKnow1](https://forums.unrealengine.com/u/IKnowYouKnow1)\
**Post date:** [April 4, 2023, 7:03am UTC](https://forums.unrealengine.com/t/scoring-system-problem/837232/6 "2023-04-04T07:03:20Z")

</div>

I think what Xaert posted should work. What fails when you include his code?

---

<div class="post-metadata">

**Author:** ![Qwaxi34](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Qwaxi34](https://forums.unrealengine.com/u/Qwaxi34)\
**Post date:** [April 4, 2023, 10:42am UTC](https://forums.unrealengine.com/t/scoring-system-problem/837232/7 "2023-04-04T10:42:27Z")

</div>

Oh yeah it’s working 😅
