# The assignment's left hand expression type \`int\` cannot be assigned to

**URL:** <https://forums.unrealengine.com/t/the-assignments-left-hand-expression-type-int-cannot-be-assigned-to/2322533>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, question, fortnite\
**Created:** [February 8, 2025, 5:17am UTC](https://forums.unrealengine.com/t/the-assignments-left-hand-expression-type-int-cannot-be-assigned-to/2322533 "2025-02-08T05:17:11Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![wspoon12](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@wspoon12](https://forums.unrealengine.com/u/wspoon12)\
**Post date:** [February 8, 2025, 5:17am UTC](https://forums.unrealengine.com/t/the-assignments-left-hand-expression-type-int-cannot-be-assigned-to/2322533/1 "2025-02-08T05:17:11Z")

</div>

![howdoifix](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/8/5/785991d0ac3dc17906885568a443616d6d5ed11d.png)

Hello guys i wanna make collectibles custom items for my game but ım getting this error whats the reason where am i making mistakes?

---

<div class="post-metadata">

**Author:** ![im\_a\_lama](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/im_a_lama/32/995063_2.png) [@im\_a\_lama](https://forums.unrealengine.com/u/im_a_lama)\
**Post date:** [February 8, 2025, 9:56am UTC](https://forums.unrealengine.com/t/the-assignments-left-hand-expression-type-int-cannot-be-assigned-to/2322533/2 "2025-02-08T09:56:45Z")

</div>

CollectAmount needs to be a var

---

<div class="post-metadata">

**Author:** ![wspoon12](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@wspoon12](https://forums.unrealengine.com/u/wspoon12)\
**Post date:** [February 8, 2025, 5:36pm UTC](https://forums.unrealengine.com/t/the-assignments-left-hand-expression-type-int-cannot-be-assigned-to/2322533/3 "2025-02-08T17:36:23Z")

</div>

I have a last question, how do i connect two scripts togather  
I want to define the same agentdata on the other device  
I searched everywhere but couldn’t find anything

 ![ASK123](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/8/b/f8b804fc6b4840c16b2af974c05d5aca8eeee2cc.png)

---

<div class="post-metadata">

**Author:** ![Mineblo](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mineblo/32/1203575_2.png) [@Mineblo](https://forums.unrealengine.com/u/Mineblo)\
**Post date:** [February 8, 2025, 6:15pm UTC](https://forums.unrealengine.com/t/the-assignments-left-hand-expression-type-int-cannot-be-assigned-to/2322533/4 "2025-02-08T18:15:42Z")

</div>

`@editable TycoonMainDevice : tycoon_main_device = tycoon_main_device{}`

Then you link the first creative device with the other and use TycoonMainDevice before anything that references it eg `TycoonMainDevice.MyFunction(Agent)`

---

<div class="post-metadata">

**Author:** ![wspoon12](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@wspoon12](https://forums.unrealengine.com/u/wspoon12)\
**Post date:** [February 9, 2025, 7:42am UTC](https://forums.unrealengine.com/t/the-assignments-left-hand-expression-type-int-cannot-be-assigned-to/2322533/5 "2025-02-09T07:42:29Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/7/8/9/78912a4e183e8a35307518b79d0f6bc687b6eb2c.png)

ı referance it but dosent work

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/6/b/b6b2544ede01c77740adddc36642a077fd188bf0.png)

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/7/a/57a1a460828809151bb4e62c3ee4bfec448b1229.png)

I tried several combinations but none worked

---

<div class="post-metadata">

**Author:** ![Mineblo](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mineblo/32/1203575_2.png) [@Mineblo](https://forums.unrealengine.com/u/Mineblo)\
**Post date:** [February 9, 2025, 3:01pm UTC](https://forums.unrealengine.com/t/the-assignments-left-hand-expression-type-int-cannot-be-assigned-to/2322533/6 "2025-02-09T15:01:07Z")

</div>

Is agent\_data instanced anywhere in any device?

---

<div class="post-metadata">

**Author:** ![wspoon12](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@wspoon12](https://forums.unrealengine.com/u/wspoon12)\
**Post date:** [February 10, 2025, 1:20am UTC](https://forums.unrealengine.com/t/the-assignments-left-hand-expression-type-int-cannot-be-assigned-to/2322533/7 "2025-02-10T01:20:06Z")

</div>

yes inside the tycoon\_main\_device

---

<div class="post-metadata">

**Author:** ![Mineblo](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mineblo/32/1203575_2.png) [@Mineblo](https://forums.unrealengine.com/u/Mineblo)\
**Post date:** [February 10, 2025, 1:45am UTC](https://forums.unrealengine.com/t/the-assignments-left-hand-expression-type-int-cannot-be-assigned-to/2322533/8 "2025-02-10T01:45:19Z")

</div>

then you would need to reference that instead, eg if its named `TheAgentData : agent_data = agent_data{}`

then you’d do `set TycoonMainDevice.TheAgentData.Money = 15.0`

---

<div class="post-metadata">

**Author:** ![wspoon12](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@wspoon12](https://forums.unrealengine.com/u/wspoon12)\
**Post date:** [February 11, 2025, 3:22am UTC](https://forums.unrealengine.com/t/the-assignments-left-hand-expression-type-int-cannot-be-assigned-to/2322533/9 "2025-02-11T03:22:12Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/6/d/d6d0cb8164579d2a958fb3e49815989e6122dfda.png)

Still the same  
I just want to define the money value in tycoon\_main\_device to collectibles\_device and add a certain amount of money when an item is collected

---

<div class="post-metadata">

**Author:** ![Mineblo](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/mineblo/32/1203575_2.png) [@Mineblo](https://forums.unrealengine.com/u/Mineblo)\
**Post date:** [February 11, 2025, 3:56am UTC](https://forums.unrealengine.com/t/the-assignments-left-hand-expression-type-int-cannot-be-assigned-to/2322533/10 "2025-02-11T03:56:59Z")

</div>

TheAgentData Does not exist in tycoon\_main\_device it needs to exist for it to be referenced from a different device

---

<div class="post-metadata">

**Author:** ![wspoon12](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@wspoon12](https://forums.unrealengine.com/u/wspoon12)\
**Post date:** [February 12, 2025, 3:58am UTC](https://forums.unrealengine.com/t/the-assignments-left-hand-expression-type-int-cannot-be-assigned-to/2322533/11 "2025-02-12T03:58:08Z")

</div>

Yes, this worked, but I think I need to go a different way. I don’t know why, but when the item is collected, it does not change the money value.  
I think I need to update the UI as well, but I still can’t figure out how to call it in this code.
