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)
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