#I need helpp

40 messages · Page 1 of 1 (latest)

winter burrow
#

I can't transform this table into string

#
local SkillZ = script.SkillZ:GetChildren()
local SkillX = script.SkillX:GetChildren()


local KeyReferences = {
    [Enum.KeyCode.Z] = SkillZ,
    [Enum.KeyCode.X] = SkillX
}

UIS.InputBegan:Connect(function(Input)
    print(KeyReferences[Input.KeyCode])
end)
#

when run and I press "z" I receive this table:

#

but I'd like a string, not table, how I do this?

lime summit
#

did you try doing something like this already?

local var = KeyReferences[Input.KeyCode][1]
winter burrow
#

but I dont understanted why, u can explain me pls ?

lime summit
#

so for example

local a = {"apple", "orange", "banana"}

a[1] is apple
a[2] is orange
a[3] is banana

winter burrow
#

aaah, I got it, thank you very much!!

lime summit
#

np

winter burrow
#

@lime summit hey, can u explain me another thing pls ? how I change the "var" in a instance ? Could I do this?:

script.SkillZ:FindFirstChild(var)

lime summit
winter burrow
#

I need require this modules

#

but I can't

#

one sec

#

for example

lime summit
#

ohhhh

winter burrow
vital roseBOT
#

studio** You are now Level 1! **studio

lime summit
#

have you tested if it works?

winter burrow
#

yes

#

dont work

#

wait

#

this is the module

lime summit
#

i think the issue might be that var or whatever you want the variable to be named is an instance and not a string, try using require(var) if it works

winter burrow
#

ok

#

dont worked :(

#

A

#

worked :)

#

I was forgetting the ":Activate" uhsushuhsa

#

ty a lot again

#

:) I won't disturb you anymore

lime summit
#

its alr

#

if u ever need help u can ask me