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

Your title should be specific! Describe your problem concisely?

so i am trying to make a sword do no damage when it hits a shield:

while true do
	if script.Parent.Handle.CFrame == game.Workspace:FindFirstChild(Shield).VariantShield.detect.CFrame then
		damage = 0
		slash_damage = 0
		lunge_damage = 0
		wait(1)
	end
end``

does findfirstchild look for something in workspace called 'Shield'

the issue comes with this:

19:45:48.166 - Argument 1 missing or nil

kinda new to scripting so if u can please help thanks

1 comment

0

You're trying to find something NAMED Shield, therefore, Shield should be in quotes like this: "Shield"

1 answer

When you do FindFirstChild(Shield) you must put ("Shield") with the " or it will think the argument is non existent, E.G

local ATMPart = script.Parent

wait ()

ATMPart.Touched:connect(function(hit)
    local player = game.Players:GetPlayerFromCharacter(hit.Parent)
    local Torso = hit.Parent.Torso
    local ATM = game.Workspace.ATM
	
	
    if player and hit.Parent:FindFirstChild("Card") then
	
	wait ()
	hit.Parent.Humanoid.WalkSpeed = 0

Notice I put ("Card") instead of (Card) because " makes it a string you are looking for, " " Will be used plenty of times during things such as this, If I helped then please accept my answer c;

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