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

How do i fix the arguement missing or nil error?

local rp = game:GetService("ReplicatedStorage")
local Punch = rp:WaitForChild("Punch")

local TweenService = game:GetService("TweenService")

local Animations = script:WaitForChild("Animations")

local R15 = 
	{
		["L"] = Animations.R15.Combat1,
		["LL"] = Animations.R15.Combat2,
		["LLL"] = Animations.R15.Combat3,
	}

Punch.OnServerEvent:Connect(function(Player,comSeq)
	local Character = Player.Character
	local Humanoid = Character.Humanoid
	local HumanoidRP = Character.HumanoidRootPart

	local Stand = Character:FindFirstChild("Stand")
	if Stand then
		local AnimControl = Stand:FindFirstChild("AnimControl")
		if AnimControl then
			
			local Controller = Stand.PrimaryPart:FindFirstChild("Controller")
			if Controller then
				local goal = {}
				goal.C0 = Controller.Part0.CFrame:ToObjectSpace(Controller.Part1.CFrame)
				goal.C1 = Controller.Part0.CFrame:ToObjectSpace(Controller.Part1.CFrame * CFrame.new(0,.25,-3))
				local info  TweenInfo.new(.25)
				local Tween = TweenService:Create(Controller,info,goal)
				Tween:Play()
			end
			
			local Action
			
				local HumanoidType = AnimControl:FindFirstChild("HumanoidType")
			if HumanoidType.Value == "R15" then
				Action = AnimControl:LoadAnimation(R15[comSeq])
				
			elseif HumanoidType.Value == "R6" then
				print("thats not good :/")
			end
			Action:Play()
			
			Action.Stopped:Connect(function()
				Punch:FireClient(Player,true)
			end)
			end

	else

		Punch:FireClient(Player,false)
	end
end)

ERROR: Argument 2 missing or nil

Line:31

1 answer

✓ Accepted answer

info needs to be defined. I think the error is on line 30, as it reads "local info TweenInfo.new(.25)"

Try setting info equal to what you want it to do.

local info = TweenInfo.new(
length(how long it takes in seconds), 
Easing style, 
Easing direction, 
times repeated, 
does it reverse, 
delay in seconds)

2 comments

0

thank you

0

no problem!

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