Why is this script not working?

-- Services --
local ReplicatedStore = game:GetService("ReplicatedStorage")
local playerService = game:GetService("Players")

-- Variables --
local OnTapEvent = ReplicatedStore:WaitForChild("OnTap")
local player = playerService.LocalPlayer
local button = script.Parent

-- Events --
button.MouseButton1Down:Connect(function()
	script.Parent:TweenSize(UDim2.new(0.114, 0, 0.206, 0), "Sine", "Out", .2, true)
	OnTapEvent:FireServer(player)
end)


button.MouseButton1Up:Connect(function()
	script.Parent:TweenSize(UDim2.new(0.107, 0, 0.196, 0), "Sine", "In", .2, true)
end)

I don’t understand what is wrong with this code…

Don’t have time to try my solution, but I think Sine might be the issue. Try using Enum.EasingStyle.Sine instead. Also try it with the easing direction (Enum.EasingDirection.In)

I’ll try, but Isn’t using “Sine” the same thing as Enum.EasingStyle.Sine?
Edit: didn’t change anything it still is buggy

Show us the new script, please.

It’s just “Sine” replaced with Enum.EasingStyle.Sine :man_shrugging:

Replace the “In” and “Out” with the enum equivalents. I think that is the issue with your code as there is not any other strings that should cause errors.

No, it’s totally different.

It is asking for a EasyingStyle datatype, not a string.

More information found here

1 Like

image

Bro that wouldn’t do anything… “Sine” is the same with Enum.EasingStyle.Sine aswell as “In” with Enum.EasingDirection.In and etc

I just changed it anyway in the script, and sadly it still hasn’t been fixed :frowning:

Show us the new script… so we can see. :smile:

What line is it talking about exactly? Also, is this the entire script?

Sure here you go:

-- Services --
local ReplicatedStore = game:GetService("ReplicatedStorage")
local playerService = game:GetService("Players")

-- Variables --
local OnTapEvent = ReplicatedStore:WaitForChild("OnTap")
local player = playerService.LocalPlayer
local button = script.Parent

-- Events --
button.MouseButton1Down:Connect(function()
	script.Parent:TweenSize(UDim2.new(0.114, 0, 0.206, 0), Enum.EasingStyle.Sine, Enum.EasingDirection.Out, .2, true)
	OnTapEvent:FireServer(player)
end)


button.MouseButton1Up:Connect(function()
	script.Parent:TweenSize(UDim2.new(0.107, 0, 0.196, 0), Enum.EasingStyle.Sine, Enum.EasingDirection.In, .2, true)
end)

Line 12 … and 18

char limit ykykyk

I figured… What line is that? the markdown doesn’t have line numbers.

Could you explain what you mean please?

What is the actual code on the line? I don’t know what line 12 or 18 are.

Line 12:

	script.Parent:TweenSize(UDim2.new(0.114, 0, 0.206, 0), Enum.EasingStyle.Sine, Enum.EasingDirection.Out, .2, true)

Line 18:

	script.Parent:TweenSize(UDim2.new(0.107, 0, 0.196, 0), Enum.EasingStyle.Sine, Enum.EasingDirection.In, .2, true)

I couldn’t tell you what is wrong. Is it still the same error?

You have your EasingSytle and Easing Direction in the wrong Position, replace Out with Sine and Sine with Out.

2 Likes