# Why does it return "TemporalAleatorio" I think it should return a float

**URL:** <https://forums.unrealengine.com/t/why-does-it-return-temporalaleatorio-i-think-it-should-return-a-float/1977202>\
**Category:** Verse\
**Tags:** unreal-editor-for-fortnite, fortnite-creative, question, fortnite\
**Created:** [August 15, 2024, 4:58pm UTC](https://forums.unrealengine.com/t/why-does-it-return-temporalaleatorio-i-think-it-should-return-a-float/1977202 "2024-08-15T16:58:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fali](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/fali/32/1072003_2.png) [@Fali](https://forums.unrealengine.com/u/Fali)\
**Post date:** [August 15, 2024, 4:58pm UTC](https://forums.unrealengine.com/t/why-does-it-return-temporalaleatorio-i-think-it-should-return-a-float/1977202/1 "2024-08-15T16:58:49Z")

</div>

Why does it return “TemporalAleatorio” I think it should return a float

I’m sorry for the errors in my code, but I’m trying to make a randomization system for my murder game, to choose between Murder, Sheriff or Innocent.

And what I do in the code is take the name of the players (I assume for now mine is displayed) and give them a percentage!

Thank you all! I see a lot of help in other discussions and you always find a solution! Wow!

```auto
using { /Fortnite.com/Characters }
using { /Fortnite.com/Devices }
using { /Fortnite.com/Game }
using { /Fortnite.com/UI }
using { /Verse.org/Simulation }
using { /Verse.org/Random }
using { /Verse.org/Assets }
using { /Verse.org/Colors }
using { /UnrealEngine.com/Temporary/SpatialMath }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /UnrealEngine.com/Temporary/UI }

SeleccionAsesino := class(creative_device):

    var PlayerMap : [player]SeleccionAsesino = map{}
    MakeAgentName<localizes> (Agent:agent):message= "{Agent}"
    ConvertirTexto<localizes> (:[]float):message= "{TemporalAleatorio}"

    var TemporalAleatorio : []float = array{}
    var Temporal : float = 0.0

    @editable var MinimoAleatorio : float = 0.0
    @editable var MaximoAleatorio : float = 100.0

    @editable ItemGranterAsesino : item_granter_device = item_granter_device{}
    @editable ItemGranterSheriff : item_granter_device = item_granter_device{}
    @editable ItemGranterInocente : item_granter_device = item_granter_device{}

    @editable TriggerActivador : trigger_device = trigger_device{}

    OnBegin< override>()<suspends>:void=
        Print("Carga el OnBegin a la espera del activador")
        TriggerActivador.TriggeredEvent.Subscribe(ComenzarVotacion)

    ComenzarVotacion(Agent : ?agent):void=
        Print("Comienza el calculo\nEmpezamos obteniendo los numeros aleatorios para cada jugador")
        AllPlayers := GetPlayspace().GetPlayers()
        for (EliminationGamePlayer : AllPlayers):
            if (FortCharacter := EliminationGamePlayer.GetFortCharacter[]):
                set TemporalAleatorio += array:
                    GetRandomFloat(MinimoAleatorio, MaximoAleatorio) 
                Print(ConvertirTexto(TemporalAleatorio))     
                ObtenerNombres(Agent)                 
                          
                    
    ObtenerNombres(Agent:?agent):void=
        if (CastAgent := agent[Agent?]): # Funcion para convertir Agent? en "Agent"
            Username : message = MakeAgentName(CastAgent)
            Print(Username)    
            
  

```

---

<div class="post-metadata">

**Author:** ![Fali](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/fali/32/1072003_2.png) [@Fali](https://forums.unrealengine.com/u/Fali)\
**Post date:** [August 15, 2024, 5:19pm UTC](https://forums.unrealengine.com/t/why-does-it-return-temporalaleatorio-i-think-it-should-return-a-float/1977202/2 "2024-08-15T17:19:07Z")

</div>

I think the problem is here… but I have no idea how to declare a Float…

```auto
ConvertirTexto<localizes> (:[]float):message= "{TemporalAleatorio}"

```

---

<div class="post-metadata">

**Author:** ![Fali](https://d1ap1mz92jnks1.cloudfront.net/user_avatar/forums.unrealengine.com/fali/32/1072003_2.png) [@Fali](https://forums.unrealengine.com/u/Fali)\
**Post date:** [August 15, 2024, 5:47pm UTC](https://forums.unrealengine.com/t/why-does-it-return-temporalaleatorio-i-think-it-should-return-a-float/1977202/3 "2024-08-15T17:47:36Z")

</div>

Well, I published this and after a while I managed to get it right, I had been dealing with this problem all day and looking for solutions

I hope it helps you

```auto
using { /Fortnite.com/Characters }
using { /Fortnite.com/Devices }
using { /Fortnite.com/Game }
using { /Fortnite.com/UI }
using { /Verse.org/Simulation }
using { /Verse.org/Random }
using { /Verse.org/Assets }
using { /Verse.org/Colors }
using { /UnrealEngine.com/Temporary/SpatialMath }
using { /UnrealEngine.com/Temporary/Diagnostics }
using { /UnrealEngine.com/Temporary/UI }

SeleccionAsesino := class(creative_device):

    var PlayerMap : [player]SeleccionAsesino = map{}
    MakeAgentName<localizes> (Agent:agent):message= "{Agent}"
    ConvertirTexto<localizes> (:[]float):message= "{TemporalAleatorio}"

    var TemporalAleatorio : []float = array{}
    var Temporal : float = 0.0

    @editable var MinimoAleatorio : float = 0.0
    @editable var MaximoAleatorio : float = 100.0

    @editable ItemGranterAsesino : item_granter_device = item_granter_device{}
    @editable ItemGranterSheriff : item_granter_device = item_granter_device{}
    @editable ItemGranterInocente : item_granter_device = item_granter_device{}

    @editable TriggerActivador : trigger_device = trigger_device{}

    OnBegin< override>()<suspends>:void=
        Print("Carga el OnBegin a la espera del activador")
        TriggerActivador.TriggeredEvent.Subscribe(ComenzarVotacion)

    ComenzarVotacion(Agent : ?agent):void=
        Print("Comienza el calculo\nEmpezamos obteniendo los numeros aleatorios para cada jugador")
        AllPlayers := GetPlayspace().GetPlayers()
        for (EliminationGamePlayer : AllPlayers):
            if (FortCharacter := EliminationGamePlayer.GetFortCharacter[]):
                temp : float = GetRandomFloat(MinimoAleatorio, MaximoAleatorio)  
                set TemporalAleatorio += array:
                    temp
                
                Print("{temp}") 
                ObtenerNombres(Agent)                 
                          
                    
    ObtenerNombres(Agent:?agent):void=
        if (CastAgent := agent[Agent?]): # Funcion para convertir Agent? en "Agent"
            Username : message = MakeAgentName(CastAgent)
            Print(Username)    
            

```

---

<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:** [September 14, 2024, 5:48pm UTC](https://forums.unrealengine.com/t/why-does-it-return-temporalaleatorio-i-think-it-should-return-a-float/1977202/4 "2024-09-14T17:48:28Z")

</div>

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