Hey there! I want to change the state of a player map logic in the script in line. 30 & 32, but for some reason the P := Framework.CustomPlayer[Player] causes an error & it doesn’t allow me to set the variable.
Anyone have a clue what the issue could be? ![]()
using { /Fortnite.com/Devices }
using { /Fortnite.com/Playspaces }
using { /Verse.org/Colors }
using { /Verse.org/Random }
using { /Verse.org/Simulation }
using { /Verse.org/Simulation/Tags }
using { /UnrealEngine.com/Temporary/Diagnostics }
SpawningPads := class(tag){}
# Dancing Tile Class.
TileClass := class<concrete>():
var Framework : GameFramework = GameFramework{}
@editable Area : mutator_zone_device = mutator_zone_device{}
@editable Tile : prop_manipulator_device = prop_manipulator_device{}
Setup(): void :=
Area.AgentBeginsEmotingEvent.Subscribe(OnAgentEmoting)
OnAgentEmoting(Agent:agent): void :=
Print("@Tile - An agent started emoting.")
if:
Player := player[Agent]
P := Framework.CustomPlayer[Player]
then:
set P.HasClaimed = true
Area.Disable(), Tile.HideProps()
Print("@Tile - An agent captured a tile succesfully.")
#Custom Music Class.
MusicClass := class<concrete>():
@editable var Label : string = "Insert Label"
@editable var Music : audio_player_device = audio_player_device{}
# Custom Player Class.
PlayerClass := class<concrete>():
var IsPlaying : logic = false
var HasClaimed : logic = false
# Framework Device Class.
GameFramework := class(creative_device):
var CustomPlayer : [player]PlayerClass = map{}
OnBegin<override>()<suspends>: void :=
TaggedSpawners := GetCreativeObjectsWithTag(SpawningPads{})
for (TaggedSpawner : TaggedSpawners, Spawner := player_spawner_device[TaggedSpawner]):
Spawner.SpawnedEvent.Subscribe(OnAgentSpawn)
OnAgentSpawn(Agent:agent): void :=
if (Player := player[Agent]):
OnPlayerSpawn(Player)
OnPlayerSpawn(Player:player): void :=
if (Existing := CustomPlayer[Player]){}
else. if (set CustomPlayer[Player] = PlayerClass{}){}
Print("@PlayerManager - A player has been setup.")