Help fixing Springs script

So, I watched this tutorial by @EgoMoose that was made about 5 years ago on his YouTube channel demonstrating and explaining springs and Hooke’s law. I really love swaying movements and cartoony, sling-y effects, so I of course was going to check it out. I had done what he did in the video and wrote out the scripts and everything, but once I pressed play I got a nil error in the local script. If you could help out, that’ll be greatly appreciated. Here’s the Module and Local sciript - the error is in the Local script on line 16 (" spring:update() "):

Module Script:

local spring = {};

function spring.new(position, velocity, target)
	selfs = setmetatable({}, {_index = spring});
	
	selfs.position = position;
	selfs.velocity = velocity;
	selfs.target = target;
	selfs.k = 1;
	selfs.friction = 1;
	
	return selfs;
end;

function spring:update()
	local d = (selfs.target - selfs.position);
	local f = d * selfs.k;
	selfs.velocity = (selfs.velocity * (1 - selfs.friction)) + f;
	selfs.position = selfs.position + selfs.velocity
end;

return spring;

Local Script:

local part = Instance.new("Part", game.Workspace);
part.Anchored = true;
part.BrickColor = BrickColor.Green();

local mouse = game.Players.LocalPlayer:GetMouse();
mouse.TargetFilter = part;

local springModule = require(game.Workspace.Spring);
local spring = springModule.new(part.CFrame.p, Vector3.new(), mouse.Hit.p);

spring.k = 0.05;
-- spring.friction = 0.1;

game:GetService("RunService").RenderStepped:Connect(function()
	spring.target = mouse.Hit.p;
	spring:update();
	part.CFrame = CFrame.new(spring.position);
end);

You don’t need to include the game file for support, for people’s safety with virus and other malicious content don’t provide a file download.

It is much easier for people to give support on topics like this if you just copy and paste the code in a text block along with the error.

OK, thanks. I’ll try typing in the code.

Change this to self. Variable selfs is not defined.

So I should change ‘selfs’ to ‘self’?

Yes. Variable selfs is not defined. self allows for self references.

Oh, It was a keyword so I thought I shouldn’t use it.

OK, I just changed the variable to ‘self’ but it didn’t work. It still gives me an error for that same line.