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

Character is not a valid member of Model "Workspace.tanQer8"?

game.ReplicatedStorage.Remotes.Punch.OnServerEvent:Connect(function(player,damage)
		    for i,target in pairs(game.Workspace:GetChildren()) do
			        if target:FindFirstChild("Humanoid") and target.Parent.Name ~= player.Name then
				            if (target.Character.HumanoidRootPart.Position - player.Character.HumanoidRootPart.Position).magnitude <5 then
					                target.character.Humanoid.Health -= damage
					            end
				        end
			    end
		end)

This i accually dont under stand why line 4 isn't working. here is the full error:

Character is not a valid member of Model "Workspace.tanQer8" - Server - Punch Server:4 Stack Begin - Studio Script 'ServerScriptService.Punch Server', Line 4 - Studio - Punch Server:4 Stack End - Studio

2 answers

Hey,

Try to define character as 'local Character = Player.Character or Player.CharactedAdded:Wait()'

Hey! I am not entirely sure if I know what you mean, but Character is only a property of game.Players.tanQer8, not Workspace.tanQer8.

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