I was making a tool, which I have done many times before but it keeps throwing out this error:
09:37:48.661 - Value is not a valid member of Model
09:37:48.662 - Stack Begin
09:37:48.662 - Script 'ServerScriptService.Saber', Line 3
09:37:48.662 - Stack End
I have checked multiple times but still can't find what the issue is.
Here is my local Script:
local debounce = false
local Force = script.Parent:WaitForChild("Force")
script.Parent.Equipped:Connect(function()
local Player = game.Players.LocalPlayer
local plr = game.Workspace:FindFirstChild(Player.Name)
local Anim = script.Parent.Equip
local Track = plr.Humanoid:LoadAnimation(Anim)
Track:Play()
script.Parent.Activated:Connect(function()
if debounce then
print("Anim Playing")
else
debounce = true
--Play Animation--
local Player = game.Players.LocalPlayer
local plr = game.Workspace:FindFirstChild(Player.Name)
local Anim = script.Parent.Swing
local Track = plr.Humanoid:LoadAnimation(Anim)
Track:Play()
game.ReplicatedStorage.Saber:FireServer(plr,Force)
wait(0.7)
debounce = false
end
end)
end)
Here is my server Script:
game.ReplicatedStorage.Saber.OnServerEvent:Connect(function(plr,Force)
local Player = game.Players:FindFirstChild(plr.Name)
Player.leaderstats.Force.Value = Player.leaderstats.Force.Value + Force.Value
end)
Thanks in advance
