So this is the script:
local ev = script.Parent local debounce = false local Track = nil ev.OnServerEvent:Connect(function(player) local blade = player.Character:FindFirstChild("Blade") player.PlayerStats.SwordExp.Value = player.PlayerStats.SwordExp.Value + 10 local scc = script.Script:Clone() local Anim1 = script.anim1 local Anim2 = script.anim2 local char = player.Character or player.CharacterAdded:Wait() if debounce == false then debounce = true Track = char.Humanoid:LoadAnimation(Anim1) Track:Play() scc.Parent = blade game.Debris:AddItem(scc,.5) else debounce = false Track = char.Humanoid:LoadAnimation(Anim2) Track:Play() scc.Parent = blade end if player.PlayerStats.SwordExp.Value / player.PlayerStats.MaxSwordExp.Value >= 1 then player.PlayerStats.SwordLvl.Value = player.PlayerStats.SwordLvl.Value + 1 player.PlayerStats.MaxSwordExp.Value = player.PlayerStats.MaxSwordExp.Value + 10 player.PlayerStats.SwordExp.Value = 0 end if player.PlayerStats.SwordLvl.Value <= 1 then player.PlayerStats.MaxSwordExp.Value = 1000 end end)
I need to put that scc script into the blade when needed which should work but doesn't cause i cannot manage to define the blade properly. Any ideas how to fix this?
Overall, if WaitForChild doesn't find it ever, then that means that it's never being created or moved. WaitForChild can and will find something, no matter how long it takes. Make sure that "Blade" is actually being created. You may have forgotten to clone it, or something. If it's an equippable object, the model won't be moved into the player until it is equipped.
In stead of FindFirstChild use WaitForChild. Heres an Example:
local blade = player.Character:WaitForChild("Blade")
Your friend, Spiral
try this
if the blade is the parent of this script you can identify it by simply doing
local blade = script.Parent
or if it's something else, why not try:
local blade = player.Character.Blade