Need Some help with a script!

Im using game.ReplicatedStorage.Moduals.Spritesheets.FindNumber:GetAttribute("Number") ~= 1 to see if the value does not equal one, but it doesn’t seem work, what am I doing wrong?
The full code:

	PlayerGui.Main.Inventory[7].MouseLeave:Connect(function()
		if SlotToOpen ~= 7 or game.ReplicatedStorage.Moduals.Spritesheets.FindNumber:GetAttribute("Number") ~= 7 then
		PlayerGui.Main.Inventory[7]:TweenPosition(
			UDim2.new(0.65, 0,0.15, 0),
			"Out",
			"Quad",
			.1,
			true
		)			
		end

	end)

What is PlayerGui.Main.Inventory[7]? That is not how indexing works.
Edit: PS use tween service, its way better.

It doesn’t matter which one you use, tween service or basic tweenposition, tweensize or both at the same time

It doesn’t matter but I recommend learning tween service because in the future he’ll have to learn it anyway.

There’s nothing to learn in tweenservice lol, what are you talking about

What do you mean there’s nothing to learn about tweens?

That’s basically all Gui manipulation uses

You can just copy some tween service example code and adapt it for yourself, tweenservice and both tweensize and position are all the same

Edit: basics of tween service is enough, i mean tween service is overall easy to learn

Thats a bit lazy. If you dont know how to write it yourself, how will you know what went wrong with your tween animation?

As i wrote in my edit, tween service is easy to learn, it’s one of the things on roblox you can learn in 10 minutes

You should’ve just said that instead of telling them it’s just useless and there’s nothing to learn

1 Like

Ngl we’re out of topic because of that crap, the guy above still needs the help lol

1 Like

True but I can’t read his syntax

Exactly why he should learn it. It takes 10 minutes and it’s incredibly useful. Please don’t tell people to copy and paste. In some cases it is acceptable, but when its something really easy to learn, it is best to not copy and paste, so you can actually learn instead of relying on other people.

2 Likes

The problem is that tween service takes bunch of time to write + sometimes ure just lazy to remember the code, that’s why i copy and paste it and then adapt it instead of writing from the very start

You cannot be lazy when coding. It is a bad practice and you should never do it with the exception of incredibly long lines of code.

Um, none of these answers my original question.

1 Like

I can agree but sometimes it’s just boring to write something you’ve been writing for thousands of times

Read my first post. We need a bit more info to help out.

PlayerGui.Main.Inventory[7], is a frame, one of seven frames in my inventory system, I am attempting to tween this Gui, and the game.ReplicatedStorage.Moduals.Spritesheets.FindNumber:GetAttribute("Number") ~= 1 is checking if the player has this frame open, but game.ReplicatedStorage.Moduals.Spritesheets.FindNumber:GetAttribute("Number") ~= 1 even if the value is equal to 1 it still tweens the Gui.
Hopefully this makes sense

Can you show me the explorer? I think you have to do Inventory[“7”] or it registers as a number.