Hello, this is my first game without trying to skid, I have 2 errors on my code, ill say the error for both of them and the code
Error: Events is not a valid member of Players “Players”
Code
local Tool = script.Parent
local EventFolder = Tool.Events
local Animations = script.Parent.Animations
local ClickedEvent = EventFolder.Clicked
local Player = game.Players.LocalPlayer
local Character = Player.Character
local Humanoid = Character.Humanoid
local Button1Down
local Debounce = true
local Mouse = Player:GetMouse()
Tool.Equipped:Connect(function()
if Humanoid.Health == 0 then return end
Button1Down = Mouse.Button1Down:Connect(function()
if Humanoid.Health == 0 then return end
if Debounce == true then Debounce = false
ClickedEvent:InvokeServer()
print("Invoked ClickedEvent")
wait(2)
Debounce = false
end
end)
end)
Error: leaderstats is not a valid member of Tool “Players.Remingling.Backpack.Weight”
Code 2
Code:
local Tool = script.Parent
local EventFolder = Tool.Events
local ClickedEvent = EventFolder.Clicked
local Player = game.Players.LocalPlayer
local Strength = script.Parent.Parent.Parent.Parent.leaderstats.Strength
local function OnClick()
Strength = Strength + 1
end
ClickedEvent.OnServerEvent:Connect(OnClick())