# What is wrong in this verse script i tried everything

**URL:** <https://forums.unrealengine.com/t/what-is-wrong-in-this-verse-script-i-tried-everything/2063731>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, question, fortnite\
**Created:** [October 11, 2024, 4:45pm UTC](https://forums.unrealengine.com/t/what-is-wrong-in-this-verse-script-i-tried-everything/2063731 "2024-10-11T16:45:34Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mowntaindew](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mowntaindew](https://forums.unrealengine.com/u/Mowntaindew)\
**Post date:** [October 11, 2024, 4:45pm UTC](https://forums.unrealengine.com/t/what-is-wrong-in-this-verse-script-i-tried-everything/2063731/1 "2024-10-11T16:45:34Z")

</div>

# Persistent modifier to keep the state across games

persistent

# A simple test class

class SimpleTestClass extends device {  
# A simple variable  
var testVariable: int = 0 # Initialize variable

```
# A simple function to log a message
testFunction(): void = {
    log("Hello, this is a test function!")
}

```

}

and the error is

[{  
“resource”: “/C:/Users/ziadh/OneDrive/Documents/Fortnite Projects/MyProjectA/Plugins/MyProjectA/Content/BerserkMode.native.verse”,  
“owner”: “_generated\_diagnostic\_collection\_name_#0”,  
“code”: “3100”,  
“severity”: 8,  
“message”: “vErr:S77: Unexpected "SimpleTestClass" following expression”,  
“startLineNumber”: 5,  
“startColumn”: 7,  
“endLineNumber”: 5,  
“endColumn”: 7  
}]

---

<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:** [October 11, 2024, 4:50pm UTC](https://forums.unrealengine.com/t/what-is-wrong-in-this-verse-script-i-tried-everything/2063731/2 "2024-10-11T16:50:28Z")

</div>

what is BerserkMode.native.verse? do you have a screenshot on where you have the script at?  
and also MOVE YOUR PROJECTS out of ONEDRIVE it can corrupt your files

---

<div class="post-metadata">

**Author:** ![Mowntaindew](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mowntaindew](https://forums.unrealengine.com/u/Mowntaindew)\
**Post date:** [October 11, 2024, 5:04pm UTC](https://forums.unrealengine.com/t/what-is-wrong-in-this-verse-script-i-tried-everything/2063731/3 "2024-10-11T17:04:30Z")

</div>

this is an eror from before i removed it the one under it is the one i am doing now  
and the script is in myproject folder in vs code

---

<div class="post-metadata">

**Author:** ![Mowntaindew](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mowntaindew](https://forums.unrealengine.com/u/Mowntaindew)\
**Post date:** [October 11, 2024, 5:06pm UTC](https://forums.unrealengine.com/t/what-is-wrong-in-this-verse-script-i-tried-everything/2063731/4 "2024-10-11T17:06:08Z")

</div>

wait this is actually another file i that iput for my code but iput another name so i send it here

---

<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:** [October 11, 2024, 5:26pm UTC](https://forums.unrealengine.com/t/what-is-wrong-in-this-verse-script-i-tried-everything/2063731/5 "2024-10-11T17:26:56Z")

</div>

Can you show the error you get in vscode? or when building verse?

---

<div class="post-metadata">

**Author:** ![Mowntaindew](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mowntaindew](https://forums.unrealengine.com/u/Mowntaindew)\
**Post date:** [October 11, 2024, 6:24pm UTC](https://forums.unrealengine.com/t/what-is-wrong-in-this-verse-script-i-tried-everything/2063731/6 "2024-10-11T18:24:55Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/f/b/0/fb022be5cceb71485debe29835e244ad84b01268.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:** [October 11, 2024, 6:28pm UTC](https://forums.unrealengine.com/t/what-is-wrong-in-this-verse-script-i-tried-everything/2063731/7 "2024-10-11T18:28:27Z")

</div>

can you show a full screen that shows whats written around/nearby line 4?

---

<div class="post-metadata">

**Author:** ![Mowntaindew](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mowntaindew](https://forums.unrealengine.com/u/Mowntaindew)\
**Post date:** [October 11, 2024, 6:28pm UTC](https://forums.unrealengine.com/t/what-is-wrong-in-this-verse-script-i-tried-everything/2063731/8 "2024-10-11T18:28:56Z")

</div>

![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/0/6/5/06551ba9c7584fa0094acc31f859ed713934d7f8.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:** [October 11, 2024, 6:30pm UTC](https://forums.unrealengine.com/t/what-is-wrong-in-this-verse-script-i-tried-everything/2063731/9 "2024-10-11T18:30:39Z")

</div>

try writting it like this

> BerserkModeDevice := class(creative\_device):

---

<div class="post-metadata">

**Author:** ![Mowntaindew](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mowntaindew](https://forums.unrealengine.com/u/Mowntaindew)\
**Post date:** [October 11, 2024, 6:30pm UTC](https://forums.unrealengine.com/t/what-is-wrong-in-this-verse-script-i-tried-everything/2063731/10 "2024-10-11T18:30:50Z")

</div>

ok

---

<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:** [October 11, 2024, 6:31pm UTC](https://forums.unrealengine.com/t/what-is-wrong-in-this-verse-script-i-tried-everything/2063731/11 "2024-10-11T18:31:48Z")

</div>

also replace the active players line with this

> var ActivePlayers : agent = array{} # Track Players In berserkMode

---

<div class="post-metadata">

**Author:** ![Mowntaindew](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mowntaindew](https://forums.unrealengine.com/u/Mowntaindew)\
**Post date:** [October 11, 2024, 6:34pm UTC](https://forums.unrealengine.com/t/what-is-wrong-in-this-verse-script-i-tried-everything/2063731/12 "2024-10-11T18:34:15Z")

</div>

ok i think it works now but i got another error on line 26 look

 ![image](https://d3kjluh73b9h9o.cloudfront.net/original/4X/d/4/4/d44cb890bde007f592fc2bc8f46a1694778a9ecc.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:** [October 11, 2024, 6:37pm UTC](https://forums.unrealengine.com/t/what-is-wrong-in-this-verse-script-i-tried-everything/2063731/13 "2024-10-11T18:37:50Z")

</div>

> for(Player:ActivePlayers):

I’d recommend looking at some verse code to understand the syntax these seem to be based in some other language Look at the documentation for verse it might help [Programming with Verse | Unreal Editor for Fortnite Documentation | Epic Developer Community](https://dev.epicgames.com/documentation/en-us/uefn/learn-programming-with-verse-in-unreal-editor-for-fortnite)

---

<div class="post-metadata">

**Author:** ![Mowntaindew](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mowntaindew](https://forums.unrealengine.com/u/Mowntaindew)\
**Post date:** [October 11, 2024, 6:38pm UTC](https://forums.unrealengine.com/t/what-is-wrong-in-this-verse-script-i-tried-everything/2063731/14 "2024-10-11T18:38:19Z")

</div>

i used chat gpt

---

<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:** [October 11, 2024, 6:39pm UTC](https://forums.unrealengine.com/t/what-is-wrong-in-this-verse-script-i-tried-everything/2063731/15 "2024-10-11T18:39:39Z")

</div>

Yea I would NOT RECCOMEND using that at all chat gpt is really incorrect and unreliable especially regarding verse

---

<div class="post-metadata">

**Author:** ![Mowntaindew](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Mowntaindew](https://forums.unrealengine.com/u/Mowntaindew)\
**Post date:** [October 11, 2024, 6:40pm UTC](https://forums.unrealengine.com/t/what-is-wrong-in-this-verse-script-i-tried-everything/2063731/16 "2024-10-11T18:40:23Z")

</div>

ok thank u i will learn it
