Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

anyone that can help me out with this value things?

Asked by 5 years ago
Edited 5 years ago

ok so im trying to make the damage be the value of the strength but times 2 i think i did something wrong (The Strength thing is a Number value)

local tool = script.Parent

local hitsound = tool:WaitForChild("Hit")

local canattack = tool:WaitForChild("CanAttack")

local plr = tool.Parent.Parent

local char = plr.Character or plr.CharacterAdded:wait()

local larm = char:WaitForChild("Left Arm")

local rarm = char:WaitForChild("Right Arm")

local STR = plr:FindFirstChild("Strenght").Value



larm.Touched:connect(function(hit)

local hum = hit.Parent:FindFirstChild("Humanoid")

if canattack.Value == false then

if hum then

canattack.Value = true

hitsound:Play()

hum:TakeDamage(STR.Value*2)

wait()

canattack.Value = false

end

end

end)



rarm.Touched:connect(function(hit)

local hum = hit.Parent:FindFirstChild("Humanoid")

if canattack.Value == false then

if hum then

canattack.Value = true

hitsound:Play()

hum:TakeDamage(STR.Value*2)

wait()

canattack.Value = false

end

end

end)
0
You defined "STR" as "plr:FindFirstChild("Strenght").Value" I'm not sure if the "Strenght" has a child named Value, but if you refer to STR as the value then when you say "hum:TakeDamage(STR.Value*2)". I think this could be breaking it so try defining "STR" as just "plr:FindFirstChild("Strenght")" P.S. I think you meant to write "Strength instead of Strenght" songboy50 77 — 5y

Answer this question