Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How do i send a simple table through a remote Event?

Asked by 5 years ago
Edited 5 years ago

I'm trying to send this simple table

local function TakeOff(player)





        print("Called the remote event")
    local wand = player.Character:FindFirstChild("Magic") 
    print(wand.Parent.Name)
    local Energy = player.Backpack.Energy


local ArchFolder = wand:WaitForChild("Effects")
local person = wand.Parent
local Power = wand.Power.Value
local Playerfolder = game.Players:GetPlayerFromCharacter(wand.Parent)




        local c = wand.Parent.Humanoid:LoadAnimation(wand.TakeOff)
c:play()
-------------------------------------------------------------

local newfold = Instance.new("Folder")
        newfold.Parent = Playerfolder.Backpack
        newfold.Name = "ParticleDitch"

local Character = wand.Parent
    local s = Instance.new("Sound")
                    s.Name = "Takeoff"
                    s.Pitch = 1.4
                    s.SoundId = "http://www.roblox.com/asset/?id=858508159"
                    s.Volume = 5
                    s.Looped = false
                    s.archivable = false
                    s.Parent = wand.Parent.UpperTorso
                        s:play()    




        local original = {}                 

                for i,c in next, wand.Parent:GetDescendants() do
            if c:IsA'BasePart' then
                local smokestuff = ArchFolder.FlightEnterExit:Clone()
        smokestuff.Parent = c
                smokestuff.Enabled = true



                wait(0.05)
                original[c] = {
                    Transparency = c.Transparency

                }

                c.Transparency = 1

                smokestuff.Enabled = false
                else
                if c:IsA'Decal' then

                local smokestuff = ArchFolder.FlightEnterExit:Clone()
        smokestuff.Parent = c
                smokestuff.Enabled = true
                original[c] = {
                    Transparency = c.Transparency

                }
smokestuff.Enabled = false
            c.Transparency = 1



        end

                    end
                end

                    Routetofly:FireClient(player, original)
                    wait(2)
                    s:remove()
        end 

through a remote Event, and It keeps breaking because it cannot fire it through the event. How do i properly send it through?

thanks

error output--

Cannot convert mixed or non-array tables: keys must be strings

0
Can you show us your code? Pojoto 329 — 5y
0
please post full code and any error in the output radusavin366 617 — 5y
0
Where is your local script that is receiving the event? Pojoto 329 — 5y
0
its in a tool, Everything Works fine except this script, theres another function in the same script in here for landing, im just wondering how to send that table through the event. Everything else works great. I'm only focused on this one script Manelin 2 — 5y
View all comments (5 more)
0
its because the table is empty and the compiler thinks youre using a mixed table, try adding original["sample"] = 2048 on the line after original = {} radusavin366 617 — 5y
0
Thankyou, and could you please explain to me what that will do so that i understand for future reference? :) @radusavin366 Manelin 2 — 5y
0
@radusavin366 I'm afraid that didnt work :( its still coming up with the same error. I now understand why its doing that but i don't know how to index the information inside of it so that it doesn't think its empty Manelin 2 — 5y
0
its just sets the value of 2048 to the key "sample", you should learn about tables before remote events tbh radusavin366 617 — 5y
0
:remove is deprecated along with archivable. Use Destroy and Archivable, and PLEASE indent your code properly. User#19524 175 — 5y

Answer this question