Why isnt remote event being received when it should?

it wont work cuz the connection needs rockmodule which is defined after

Okay but does the last print statement still print something or what???

I am really confused at this issue now. The rock module worked perfectly for me yet it doesn’t for you.

its not that, it just the rockmodule is undefined in the connection for onground, howver when u write “on” the option appears

Yes I get that point but I am saying:

print("Starting to assign the module.")
local rockmodule = require(game.ServerScriptService:WaitForChild(“RockModule [Fixed]”))
print("Assigned the module.")
game.ReplicatedStorage:WaitForChild(“Moves”):WaitForChild(“Hammerhead”):WaitForChild(“Hammer Smash”).OnServerEvent:Connect(function(player)
print(“wow”)
local char = player.Character
local humanoid = char:FindFirstChildOfClass(“Humanoid”)
local anim = script:FindFirstChild(“Animation”)

if humanoid and anim and humanoid.Health > 1 and char.DoingMove == false and char.Stun.Value == false then
	char.Stun.Value = true
	humanoid.WalkSpeed = 0
	humanoid.JumpPower = 0
	char.DoingMove.Value = true
	local track = humanoid:LoadAnimation(anim)
	track:Play()
	local rootPart = char:FindFirstChild("HumanoidRootPart")

	task.delay(1, function()
		rockmodule.OnGround(rootPart.CFrame * CFrame.new(0, 0, -2), 5, true )
		char.Stun.Value = false
		char.DoingMove.Value = false
		humanoid.WalkSpeed = 16
		humanoid.JumpPower = 50
	end)
end
end)

grafik

You should pay more attention to the output. I tried requiring the module and it gave me this warning.

This means that your module will now wait forever instead of returning.
And your variable which should store the ModuleScript is nil. Hence the error you got.

should i use getservice? if thats there

1 Like