The question is in the title, I’m a meh scripter and I have no clue if these scripts satisfy my needs.
Here are the scripts for a SINGLE weapon.
LocalScript
local plr = game:GetService("Players").LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local hrp = char:WaitForChild("HumanoidRootPart")
local hum = char:WaitForChild("Humanoid")
local uis = game:GetService("UserInputService")
local rep = script.Parent:WaitForChild("Hahalol3")
local db = false
local dbe = false
-- Check if animation exists
local idle = script:FindFirstChild("Idle")
if not idle then
warn("darn you suck at this. (Idle) not found")
return
end
local swing = script:FindFirstChild("Swing")
if not swing then
warn("darn you suck at this. (Swing) not found")
return
end
local weee = script:FindFirstChild("Weee")
if not weee then
warn("darn you suck at this. (Weee) not found")
return
end
local animator = hum:WaitForChild("Animator")
local idletrack = animator:LoadAnimation(idle)
local swingtrack = animator:LoadAnimation(swing)
local weetrack = animator:LoadAnimation(weee)
script.Parent.Equipped:Connect(function()
if idletrack then
idletrack:Play()
end
uis.InputBegan:Connect(function(i, c)
if c then return end
if i.KeyCode == Enum.KeyCode.E then
if weetrack then
if dbe == false and db == false then
dbe = true
db = true
weetrack:Play()
rep:FireServer("mrbeastgivememoney")
task.wait(1)
db = false
task.wait(4)
dbe = false
end
end
end
end)
end)
script.Parent.Unequipped:Connect(function()
if idletrack then
idletrack:Stop()
end
end)
local conn = nil
uis.InputBegan:Connect(function(i)
if i.UserInputType == Enum.UserInputType.Keyboard then
conn = script.Parent.Activated:Connect(function()
if swingtrack then
if db == false then
db = true
dbe = true
swingtrack:Play()
rep:FireServer("mrfeast")
task.wait(1.2)
db = false
dbe = false
end
end
end)
else
if conn then
conn:Disconnect()
conn = nil
end
end
end)
Script
local hitboxx = require(game.ServerScriptService.MuchachoHitbox)
local players = game:GetService("Players")
local run = game:GetService("RunService")
local function getPlayerStats(plr)
if not plr then return nil end
local stats = plr:FindFirstChild("Stats")
if not stats then return nil end
local strength = stats:FindFirstChild("Strength")
local defense = stats:FindFirstChild("Defense")
local health = stats:FindFirstChild("Health")
local remainingPoints = stats:FindFirstChild("RemainingPoints")
return {
strength = strength,
defense = defense,
health = health,
remainingPoints = remainingPoints
}
end
local calculatedDamage
local function HahaCalculationFunny(player)
local stats = getPlayerStats(player)
if not stats or not stats.strength then
warn("Player stats or strength not found")
return
end
run.Stepped:Connect(function()
calculatedDamage = stats.strength.Value * 2 / 0.5 + 10
end)
print("Calculated damage for", player.Name, ":", calculatedDamage)
end
for _, player in players:GetPlayers() do
HahaCalculationFunny(player)
end
players.PlayerAdded:Connect(HahaCalculationFunny)
local rep = script.Parent:WaitForChild("Hahalol3")
local conn
rep.OnServerEvent:Connect(function(player: Player, act: string)
if act == "mrbeastgivememoney" then
local character = player.Character
if not character then return end
local humanoid = character:FindFirstChild("Humanoid")
if not humanoid then return end
local originalWalkSpeed = humanoid.WalkSpeed
conn = run.Stepped:Connect(function()
humanoid.WalkSpeed = 8
task.wait(0.62)
humanoid.WalkSpeed = originalWalkSpeed
conn:Disconnect()
end)
local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
if not humanoidRootPart then return end
local overlap = OverlapParams.new()
overlap.FilterType = Enum.RaycastFilterType.Exclude
overlap.FilterDescendantsInstances = {character}
local hitbox2 = hitboxx.CreateHitbox()
hitbox2.Size = Vector3.new(5, 7, 5)
hitbox2.Offset = CFrame.new(0, 0, -5)
hitbox2.CFrame = humanoidRootPart
hitbox2.DetectionMode = "Default"
hitbox2.OverlapParams = overlap
hitbox2.VelocityPrediction = true
task.wait(0.42)
hitbox2:Start()
hitbox2.Touched:Connect(function(hit, humanoid)
script.Parent.Handle.Sound:Play()
print(humanoid.Parent.Name)
local creator = Instance.new("ObjectValue")
creator.Name = "creator"
creator.Value = player
creator.Parent = humanoid
game:GetService("Debris"):AddItem(creator, 5)
local target = humanoid.Parent
local vibecheck = target:GetAttribute("Blocking")
if vibecheck == true then
print("blocked")
return
end
local targetPlayer = players:GetPlayerFromCharacter(humanoid.Parent)
if targetPlayer and _G.applyDamageWithDefense then
_G.applyDamageWithDefense(targetPlayer, calculatedDamage)
humanoid.Parent.HumanoidRootPart.Orientation += Vector3.new(90, 0, 0)
if humanoid.Health <= 0 then
local sound = Instance.new("Sound")
sound.SoundId = "rbxassetid://18299846717"
sound.Parent = humanoid.Parent.Head
sound:Play()
end
else
humanoid:TakeDamage(calculatedDamage)
humanoid.Parent.HumanoidRootPart.Orientation += Vector3.new(90, 0, 0)
if humanoid.Health <= 0 then
local sound = Instance.new("Sound")
sound.SoundId = "rbxassetid://18299846717"
sound.Parent = humanoid.Parent.Head
sound:Play()
end
end
end)
task.wait(0.2)
hitbox2:Stop()
elseif act == "mrfeast" then
local character = player.Character
if not character then return end
local humanoidRootPart = character:FindFirstChild("HumanoidRootPart")
if not humanoidRootPart then return end
local overlap = OverlapParams.new()
overlap.FilterType = Enum.RaycastFilterType.Exclude
overlap.FilterDescendantsInstances = {character}
local hitbox = hitboxx.CreateHitbox()
hitbox.Size = Vector3.new(5, 5, 5)
hitbox.CFrame = humanoidRootPart
hitbox.Offset = CFrame.new(0, 0, -5)
hitbox.DetectionMode = "Default"
hitbox.OverlapParams = overlap
hitbox.VelocityPrediction = true
task.wait(0.4)
hitbox:Start()
hitbox.Touched:Connect(function(hit, humanoid)
print(humanoid.Parent.Name)
local vel = Instance.new("BodyVelocity")
vel.MaxForce = Vector3.new(1,1,1) * math.huge
vel.Velocity = humanoidRootPart.CFrame.LookVector * 45 + humanoidRootPart.CFrame.UpVector * 20
vel.Parent = humanoid.Parent.HumanoidRootPart
game:GetService("Debris"):AddItem(vel, 0.1)
local creator = Instance.new("ObjectValue")
creator.Name = "creator"
creator.Value = player
creator.Parent = humanoid
game:GetService("Debris"):AddItem(creator, 5)
local target = humanoid.Parent
local vibecheck = target:GetAttribute("Blocking")
if vibecheck == true then
print("blocked")
return
end
local targetPlayer = players:GetPlayerFromCharacter(humanoid.Parent)
if targetPlayer and _G.applyDamageWithDefense then
_G.applyDamageWithDefense(targetPlayer, calculatedDamage / 2)
if humanoid.Health <= 0 then
local sound = Instance.new("Sound")
sound.SoundId = "rbxassetid://18299846717"
sound.Parent = humanoid.Parent.Head
sound:Play()
end
else
humanoid:TakeDamage(calculatedDamage / 2)
if humanoid.Health <= 0 then
local sound = Instance.new("Sound")
sound.SoundId = "rbxassetid://18299846717"
sound.Parent = humanoid.Parent.Head
sound:Play()
end
end
end)
task.wait(0.1)
hitbox:Stop()
end
end)
Any suggestions??
