You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
Whenever the blade touches another player’s character it damages them -
What is the issue? Include screenshots / videos if possible!
It doesn’t do any damage. -
What solutions have you tried so far? Did you look for solutions on the Developer Hub?
I have tried changing some stuff and looked on the devforum but i cant find it
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
Serverside script
local tool = script.Parent
local function damage(oPart)
if oPart.Parent:FindFirstChild("Humanoid") then
local ownerChar = tool.Parent
local ownerPlr = game:GetService("Players"):GetPlayerFromCharacter(ownerChar)
if oPart:FindFirstChild("Humanoid") and oPart:FindFirstChild("Humanoid").Parent ~= ownerChar then
local hum = oPart:FindFirstChild("Humanoid")
local oPlr = game:GetService("Players"):GetPlayerFromCharacter(hum.Parent)
if oPlr then
hum.Health -= 55
if hum.Health <= 0 then
local oMoney = oPlr.leaderstats.Money.Value
oPlr.leaderstats.Money.Value -= oMoney/10
ownerPlr.leaderstats.Money.Value += oMoney/10
end
else
hum.Health -= 75
if hum.Health <= 0 then
ownerPlr.leaderstats.Money.Value += 10
end
end
end
end
end
tool:WaitForChild("Blade").Touched:Connect(damage)
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.