Module Function wont continue further (no error shown)

I don’t understand why does the script stops even though it doesn’t have a breaking logic or any error results in my output.

This is the module function:

function module:ApplyBuff(thisPlayer : Player)
	local Character = thisPlayer.Character or thisPlayer.CharacterAdded:Wait()
	local Humanoid = Character:FindFirstChildWhichIsA("Humanoid")
	
	local parentTo = Character:FindFirstChild("HumanoidRootPart") --# Head? Torso?
	
	--# Apply Stats
	print("SSSS")
	if Humanoid then
		print("Hello")
		print(module["BuffedStats"])
		for buffName, buffValue in pairs(module["BuffedStats"]) do
			warn(buffName, buffValue)
			Humanoid[buffName] += buffValue
			print(thisPlayer.Name, "has been buffed with " + buffName)
		end

		print("FOO")
		--# Smoke
		if module["BuffStyle"].Smoke.Enabled then
			local newSmoke = Instance.new("Smoke")
			newSmoke.Size = module["BuffStyle"]["Smoke"].Size
			if module["BuffStyle"]["Smoke"].Rainbow then
				applyRainbowColor(newSmoke, "Color")
			end
			newSmoke.Name = "buff_smoke"
			newSmoke.Parent = parentTo
		end
		print("BAR")
		--# Fire
		if module["BuffStyle"].Fire.Enabled then
			local newFire = Instance.new("Fire")
			newFire.Size = module["BuffStyle"]["Fire"].Size
			if module["BuffStyle"]["Fire"].Rainbow then
				applyRainbowColor(newFire, "Color")
			end
			newFire.Name = "buff_fire"
			newFire.Parent = parentTo
		end
	else
		warn("Humanoid not found when applying stats buff.")
	end
end

This is the output when played:
image

It stops on the first index of the table.

Is this wrapped in a pcall? Also, you may need to set direct health by using some sort of mapping system.

  • Not wrapped in a pcall
  • Care to explain further?
print(thisPlayer.Name, "has been buffed with " + buffName)

This is not how you do string concatenation in lua. We use 2 dots

print(thisPlayer.Name, "has been buffed with " .. buffName)

That seems the issue. mannnnnnn I wonder why there’s no error for it.

Strange there was not a string concat error.

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