#The SkillTreeModule[v.Parent.Name] doesn't exist

84 messages · Page 1 of 1 (latest)

onyx gazelle
#

Ello, I uhh, had this Error, that it says, it doesn't exist. so, I don't know why it doesn't exist + I'm trying to make a skill tree in a yt tutorial, so.. can someone help me with it please?

mint drift
#

Show your replicated storage

onyx gazelle
#

for the inside

#

local SkillTreeModule =
{
["Health Upgrade 1"] =
{
Name = "Muscle",
Description = "You gained a muscle, now you are a muscular person. Congratulations. [Gives +25 Health.]",
Requirement = 1
},
["Health Upgrade 2"] =
{
Name = "Tank",
Description = "You are so strong that you become a Tank! Nice!! [Gives +75 Health.]",
Requirement = 5
},
["Health Upgrade 3"] =
{
Name = "Beast",
Description = "You are.. a Beast?!? Dang! You made the whole Common Enemy scared of you! [Gives +100 Health.]",
Requirement = 10
},

}

return SkillTreeModule

#

here for the open localscript

#

and here the script of the script.

#

local moduleLibrary = game:GetService("ReplicatedStorage"):WaitForChild("ModuleLibrary")
local SkillTreeModule = require(moduleLibrary:WaitForChild("SkillTreeModule"))

for i, v in pairs(script.Parent:GetDescendants()) do
local rps = game:GetService("ReplicatedStorage")
local folder = rps:WaitForChild("Events")

if v:IsA("ClickDetector") then
    v.MouseClick:Connect(function(player)
        local fire = folder:WaitForChild("SkillTree")
        fire:FireClient(player, "ChangeCanPerspective", v.Parent.Name)
        if SkillTreeModule[v.Parent.Name] then
            print(SkillTreeModule[v.Parent.Name])
        elseif not SkillTreeModule[v.Parent.Name] then
            print("Does not exist.")
        end
    end)
end

end

#

(if you cannot see it clearly)

#

soo..

#

you had any solution or anything to solve it?

uneven stump
#

If you are doing a YouTube tutorial, can't just follow the step from the video? Then there will be no erorrs

uneven stump
uneven stump
onyx gazelle
onyx gazelle
onyx gazelle
#

I mean

#

like

#

Im following the steps

#

and it got error

#

or something not work

#

so yeha

#

yeha

#

yeah

#

@uneven stump

uneven stump
#

So... What's the problem then?

onyx vectorBOT
#

studio** You are now Level 6! **studio

onyx gazelle
#

so basically, if the SkillTreeModule[v.Parent.Name] doesnt not exist then it prints out "Doesn't Exist."

uneven stump
#

Send a screenshot with the error and the script

onyx gazelle
#

theres no error in it, it just prints it does not exist.

#

so it make me confused with it.

#

here the script tho

local moduleLibrary = game:GetService("ReplicatedStorage"):WaitForChild("ModuleLibrary")
local SkillTreeModule = require(moduleLibrary:WaitForChild("SkillTreeModule"))

for i, v in pairs(script.Parent:GetDescendants()) do
local rps = game:GetService("ReplicatedStorage")
local folder = rps:WaitForChild("Events")

if v:IsA("ClickDetector") then
    v.MouseClick:Connect(function(player)
        local fire = folder:WaitForChild("SkillTree")
        fire:FireClient(player, "ChangeCanPerspective", v.Parent.Name)
        if SkillTreeModule[v.Parent.Name] then
            print(SkillTreeModule[v.Parent.Name])
        elseif not SkillTreeModule[v.Parent.Name] then
            print("Does not exist.")
        end
    end)
end

end

#

and here is the script of the script that I just send

uneven stump
#

Show SkillTreeModule module script too

onyx gazelle
#

ok

#

here

local SkillTreeModule =
{
["Health Upgrade 1"] =
{
Name = "Muscle",
Description = "You gained a muscle, now you are a muscular person. Congratulations. [Gives +25 Health.]",
Requirement = 1
},
["Health Upgrade 2"] =
{
Name = "Tank",
Description = "You are so strong that you become a Tank! Nice!! [Gives +75 Health.]",
Requirement = 5
},
["Health Upgrade 3"] =
{
Name = "Beast",
Description = "You are.. a Beast?!? Dang! You made the whole Common Enemy scared of you! [Gives +100 Health.]",
Requirement = 10
},

}

return SkillTreeModule

uneven stump
onyx gazelle
#

which should I put

#

where*

uneven stump
onyx gazelle
#

k

uneven stump
#

That's the problem... Your v.Parent.Name is one of these and in module script you don't have them in the table

onyx gazelle
#

so, how to fix this?

onyx gazelle
#

how to make them into the table?

uneven stump
#

I think you want to get the Upgrade3, right?

onyx gazelle
#

I mean like, uhh

#

I want it to be printed somehow

#

like, print the SkillTreeModule

uneven stump
onyx gazelle
#

oh

#

red line

uneven stump
#

hmm

onyx gazelle
uneven stump
#

then
local upgrade = "Health," v.Parent.Name
if SkillTreeModule[upgrade] then

onyx gazelle
onyx vectorBOT
#

studio** You are now Level 6! **studio

uneven stump
#

local upgrade = "Health"..v.Parent.Name

#

If is not working Im prob a idiot

onyx gazelle
#

ok

uneven stump
#

oh forgot a space

#

local upgrade = "Health "..v.Parent.Name

onyx gazelle
#

its fine

#

im a idiot too

#

bruh

#

instead of printing, it make the tween not go work

#

;-;

#

so, basically, print and the tween don't work.

uneven stump
#

Don't print the tween

onyx gazelle
#

no I mean

#

this

fire.OnClientEvent:Connect(function(kamunanya, skill)
if kamunanya == "ChangeCanPerspective" then
local skillPart = Main:FindFirstChild(skill)

    local tween = tweenService:Create(
        cam, 
        TweenInfo.new(1, Enum.EasingStyle.Sine, Enum.EasingDirection.Out), 
        {CFrame = skillPart.CFrame * CFrame.new(0,20,0) * CFrame.Angles(math.rad(-90),0,0)}
    )
    tween:Play()
end

end)

uneven stump
#

Well, this will just move the camera (or a part idk) around

onyx gazelle
#

well it is, but instead, it also don't work too, lol

uneven stump
#

Man... Just learn scripting and don't use YouTube tutorials, at this rate you will not learn and you will not be able to evolve, to create your own things