Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do i fix 19:52:21.443 - Touched is not a valid member of Script?

My Script

script.Parent.Touched:Connect(function(hit)
	local char = hit.Parent
	local hum = char:FindFirstChild("Humanoid")
	if hum and char.Name ~= script.Parent.Parent.Name then
		hum.Health = hum.Health - script.Dmg.Value
		script.Disabled = true
		wait(.5)
		script.Disabled = false
	end
end)

The error

19:52:19.815 - LocalizationService.RobloxLocaleId overridden to "en-us" (x2)
19:52:21.443 - Touched is not a valid member of Script      ---- this the error
19:52:21.444 - Stack Begin
19:52:21.445 - Script 'ServerScriptService.Punch.DmgScript', Line 1
19:52:21.445 - Stack End

1 answer

✓ Accepted answer

touched is a thing that only works in parts, To your error it says you were trying to add touched to a script. Scripts do not exist so therefore cannot be touched. It would be better if you defined it or at least right out your blocks

1 comment

0

ok thx i under stand

This discussion is preserved as it was. New answers, comments, and votes are closed.