Part not appearing, I have no errors either

local remote = game.ReplicatedStorage:WaitForChild("spellsRemote"):WaitForChild("auraAttackRemote")

remote.OnServerEvent:Connect(function(player)
	print("firedddd")
	
	local auraAttckClone = game.ServerStorage:WaitForChild("auraAttack"):Clone()
	print("cloned")
	
	auraAttckClone.CFrame = player.Character.HumanoidRootPart.CFrame * Vector3.new(0,5,0)
	
	auraAttckClone.Parent = workspace
	
	local humanoids = workspace:GetChildren()
	
	for i,v in ipairs(humanoids) do
		
		if v:FindFirstChild("Humanoid") and v:FindFirstChild("Humanoid") ~= player.Character.Humanoid then
			local enemy = v;
			
			local range = (player.Character.HumanoidRootPart.CFrame.Position - enemy.HumanoidRootPart.CFrame.Position).Magnitude
			
			if range < 20 then
				enemy.Humanoid:TakeDamage(50)
				
				game:GetService("Debris").addItem(auraAttckClone,4)
			end
		end
	end
	
	
end)

The part is not appearing and no errors are showing. Remote event is sucessfully fired using local script form starterplayer scripts but onServerEvent is not picking up, I have no erroreees. Hwelp!

Why’re you trying to find the humanoid
when you have done “workspace:GetChildren()”

image


Also cleaned the code a bit:

local replicatedStorage = game:GetService("ReplicatedStorage")
local serverStorage = game:GetService("ServerStorage")

local remoteEvent = replicatedStorage.spellsRemote.auraAttackRemote

remoteEvent.OnServerEvent:Connect(function(player)
	local character = player.Character
	local humanoidRootPart = character.HumanoidRootPart
	
	local clone = serverStorage.auraAttack:Clone()
	clone.CFrame = humanoidRootPart.CFrame * Vector3.new(0, 5, 0)
	clone.Parent = game.Workspace
	
	for i, v in pairs(game.Workspace:GetChildren()) do
		
	end
end)
local remote = game.ReplicatedStorage:WaitForChild("spellsRemote"):WaitForChild("auraAttackRemote")

remote.OnServerEvent:Connect(function(player)
	print("firedddd")
	
	local auraAttckClone = game.ServerStorage:WaitForChild("auraAttack"):Clone()
	print("cloned")
	auraAttckClone.Anchored = true
	auraAttckClone.Position = player.Character.HumanoidRootPart.Position + Vector3.new(0,5,0)
	
	auraAttckClone.Parent = workspace
	
	
	for i,v in game:GetSevrice("Players"):GetPlayers() do
		
		if v.Name ~= player.Name then
			local enemy = v.Character
			
			local range = (player.Character.HumanoidRootPart.Position - enemy.HumanoidRootPart.Position).Magnitude
			
			if range < 20 and enemy:FindFirstChild("Humanoid").Health > 0 then
				enemy.Humanoid:TakeDamage(50)
				
				game:GetService("Debris").addItem(auraAttckClone,4)
			end
		end
	end
	
	
end)```

same problem; does not work and gives no error

what is the part suppose to be? Do humanoids get damaged?

its a basic 1 part, the script basically does not run, the local script sucessfully fires a remote but on server event dont work
image

Debugging.

local remote = game.ReplicatedStorage:WaitForChild("spellsRemote"):WaitForChild("auraAttackRemote")

remote.OnServerEvent:Connect(function(player)
	print("firedddd")
	
	local auraAttckClone = game.ServerStorage:WaitForChild("auraAttack"):Clone()
	print("cloned")
        print(auraAttckClone.Name)
        print((player.Character.HumanoidRootPart.Position - auraAttckClone.Position).Magnitude)
	auraAttckClone.Anchored = true
	auraAttckClone.Position = player.Character.HumanoidRootPart.Position + Vector3.new(0,5,0)
	
	auraAttckClone.Parent = workspace
	
	
	for i,v in game:GetSevrice("Players"):GetPlayers() do
		
		if v.Name ~= player.Name then
			local enemy = v.Character
			
			local range = (player.Character.HumanoidRootPart.Position - enemy.HumanoidRootPart.Position).Magnitude
			
			if range < 20 and enemy:FindFirstChild("Humanoid").Health > 0 then
				enemy.Humanoid:TakeDamage(50)
				
				game:GetService("Debris").addItem(auraAttckClone,4)
			end
		end
	end
	
	
end)```

Not working, like the script isnt running even if it is enabled, here is the local script code if it helps

the semi colons get ignored btw, I am used to java so uh kinda a habit, but those dont cause problems as far as i know

Are you sure nothing is causing the server-script to error or some-sort? try this:

local remote = game:GetService("ReplicatedStorage").spellsRemote.auraAttackRemote

Tried,not working, ong bro roblox getting me pissed, if something is wrong at least it should gimme me errors

Is that the entirety of the script btw? This might sound weird but is it disabled?

Bad Roblox.rbxl (116.2 KB)
Here take a look in yourself, but the script is fs enbaled

Why is the script in serverstorage? Scripts don’t run there, you have to put in serverscriptservice.

did it work tho? charcharcharchar

Yes.

local remote = game:GetService("ReplicatedStorage").spellsRemote.auraAttackRemote

remote.OnServerEvent:Connect(function(player)
	print("firedddd")

	local auraAttckClone = game.ServerStorage:WaitForChild("auraAttack"):Clone()
	print("cloned")
	print(auraAttckClone.Name)
	print((player.Character.HumanoidRootPart.Position - auraAttckClone.Position).Magnitude)
	auraAttckClone.Anchored = true
	auraAttckClone.Position = player.Character.HumanoidRootPart.Position + Vector3.new(0,5,0)

	auraAttckClone.Parent = workspace


	for i,v in game:GetService("Players"):GetPlayers() do

		if v.Name ~= player.Name then
			local enemy = v.Character

			local range = (player.Character.HumanoidRootPart.Position - enemy.HumanoidRootPart.Position).Magnitude

			if range < 20 and enemy:FindFirstChild("Humanoid").Health > 0 then
				enemy.Humanoid:TakeDamage(50)

				game:GetService("Debris").addItem(auraAttckClone,4)
			end
		end
	end


end)

stupid me dumb me so simple, aii thanks imma go get some rice to fuel my brain no

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.