#Color 3 not getting passed though remote function

1 messages · Page 1 of 1 (latest)

chrome moat
#

For the first script the Rng[3] value is Color3.fromRGB(202, 202, 202)

GetSpawnPartEvent.OnServerInvoke = function(player)
    print("Server Invoked for SpawnPartEvent")
    local Rng = RngClient.SelectRandom(player)

    local Color = Rng[3]
    return Color
end```
```lua
    local Data = GetSpawnPartEvent:InvokeServer(Player)
    if Data then
        local part = Instance.new("Part")
        part.Color = Data[1]```
#

Now i always get the error

17:02:51.412  Workspace.Teddy_arm.SpawnServiceNew:24: invalid argument #2 (string expected, got number)  -  Client - SpawnServiceNew:24```
So if i try and check the value of Data[1] like below i get the error above
```lua

       if not Data[1] then
           warn("No color data was given")
       end```
proper helm
#

Which line is line 24?

#

I think the only thing that cannot be passed though remotes are function, idk what you want us to fix from the code you sent, but you could try to use HEX if raw Color3 doesnt work

chrome moat
chrome moat
proper helm
#

Yeah try HEX

#

I dont see where the string expected, got number comes from since in the code you sent, you only use Color3

chrome moat
#

@proper helm okay now for some reason the error happens because of Data[1] itself, so no matter if i change it to Data[2] it throws the same error

#

any idea why?

#

I fixed it

#

a remote function can only return one thing

proper helm
#

👍