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

I gave the script names not to damage but it still damages them how do i fix?

I'm trying to make it like a party system where certain players don't get damaged but it doesn't work. IDK why ve been trying different things for 45 mins or so and I'm lost.

script.Parent.Touched:Connect(function(hit)
	print("TOUCHED")
	
	local nokill = {"hellericc","TestSub"}
	
	
	for i,v in pairs(nokill) do
		local x = Instance.new("StringValue",game.Workspace.Xhels)
		x.Name = v
		print(nokill)
		
		if hit.Parent == v.Name then
		print(hit.Parent)
		else
			wait(1)
		print("Killing")
		hit:Destroy()
		end
	
		
		
	end

	
	
end)

2 comments

0

Are you sure you didn't misspell your name in the nokill table, because other than it should be working.

0

no i did not misspell anything i'm using a different account to make the script

1 answer

Hi! In the loop you put v.Name where the string value v does not have the property name, change v.Name to v and it should work fine.

2 comments

0

or v.Name to x.Name

0

tried both but they don't work i don't know what im doing wrong

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