RobloxScripterAI
Discord ↗
Link Copied to Clipboard
×
"create a weapon script that uses string values for damage"
-- weapon script local weapon = script.Parent local damageStringValue = Instance.new("StringValue") damageStringValue.Name = "Damage" damageStringValue.Value = "10" -- Change this value to set the weapon's damage damageStringValue.Parent = weapon local function onTouched(hit) local humanoid = hit.Parent:FindFirstChild("Humanoid") if humanoid then local damage = tonumber(damageStringValue.Value) if damage then humanoid.Health = humanoid.Health - damage end end end weapon.Touched:Connect(onTouched)