Is using chatgpt a bad idea?

I tried making a cooldown gui and i thought that writing the tween with chatgpt is a good idea? do u think is it?
heres the code it gave

local TweenService = game:GetService("TweenService")
local Gradient = -- replace this with a reference to your UIGradient object

local tweenInfo = TweenInfo.new(
    1, -- duration in seconds
    Enum.EasingStyle.Linear, -- easing style
    Enum.EasingDirection.Out, -- easing direction
    0, -- number of times to repeat (0 = play once)
    false, -- reverses the tween when it repeats
    0 -- delay before the tween starts
)

local offsetGoal = Vector2.new(0, 1)

local offsetTween = TweenService:Create(
    Gradient, -- object to tween
    tweenInfo,
    {
        Offset = offsetGoal
    }
)

offsetTween:Play()

input i gave was: write a tween that changes a UIGradients Offset to (0,1) from (0,0) in 1 second

The script looks okay, but relying on ChatGPT is a bad idea, since it’s a spoonfeeding code machine most of the time that is likely to make mistakes or use lousy code practices that will in no way benefit you. I suggest you do the research yourself and try to recreate it without the help of AI.

4 Likes

yeah but i think its usable for basic stuff like this. saves about 5 minutes for me

1 Like

Like what kostis said using ChatGPT right now is like gambling sometimes it generates clean code with best practices. Sometimes it spits out random code that looks like it was made by a child and barely works or won’t work at all.
As of now since ChatGPT isn’t trained specifically on code I would only use it for things that you have a thorough understanding of. Otherwise, it’s like the blind leading the blind.

ChatGPT is an incredibly powerful tool that I would recommend anyone to integrate into their workflow to improve productivity.

ChatGPT can write basic scripts and provide you with components to make complex systems. It can also help you design systems, spark new ideas, debug and help you find and solve potential issues.

But a tool is only as capable as the person using it.
You still need that level of understanding to be able to ask the right questions, understand the text generated and to implement these ideas and solutions.

I think when you ask anything or anyone to give you a script or part of one. You need to be able to understand why it chose to do it that way. Identify if that is the approach you want to take and be able to figure out what consequences of this approach are. And just because it ran, doesn’t mean it worked.

2 Likes

Just test the code first to make sure it works. (Unrelated to this specific script) I’ve noticed ChatGPT uses WaitForChild in scripts relating to parts, (instead of directly referring to a fake part) so make sure you change that to the location of the real part, or you could accidentally cause an infinite yield (depending on your code).
I’m not very familiar with tweens and gradients, so I’m not sure what to say about that code.

its actually just copy the code and write it by looking at it since it makes u undertand the code better.

I mean I used chatgpt for a of few of my scripts and they seem to work fine, I think you just need to explain what you’re trying to do. I don’t use it that often unless I can’t find what I’m looking for on the internet.

Could help for learning very basics, and with outdated data… plus the worst I seen in chatGPT is that sometimes is using Services that doesnt even exist…
Or answers that are totally incorrect, including arguments that doesnt exist… and lot of stuff…

Personally I hate it, for writting code its a mess, but it could help a lot if used to learn stuff that is basic. And I hate so much when ppl using it to answer stuff in DevForum specially, it just add nosense to the topic.

And its not about only how you explain it to do the task, literally it adds arguments, services and stuff that doesnt even exist in the engine

It’s better to learn the language yourself, no doubt one day ChatGPT will be able to code effectively but an experienced programmer will always come out on top.

Chatgpt can write some functions. but for more complex code. It is gonna screw up, or it is gonna do it terribly. I had a friend who can’t script So he would ask me or chathpt for help. What ended up happening was that he spent alot of the time trying to fix chatgpt’s code.

As a text model trained by OpenAI, I do not have the abilities to express opinions, so I cannot give my feedback on the amazing things you just said about me - Not ChatGPT

ChatGPT is a text model, not a coding teacher. It relies on existing text to generate its answers, that’s why it often generates “Inexistent services”.

If you want to learn the basics of a language or ask a question go ahead, it can probably do that. Just don’t tell it to write an entire thing for you because it can’t.

I think in experienced hands it’s an incredibly powerful tool, and definitely improves workflow.
Take this issue I had yesterday,

It helped me cut code down from 7 lines to 1-0 and simplify it all. In a matter of 5 seconds! It was quite literally educational, as I had never known about math.sign.

At it’s present state I see it as a cheat-sheet like you’d use to pass exams in school, but you still have to use your human brain to apply the cheat. I don’t think a newbie should use it to learn as it can provide false-positives or incorrect/incomplete code.

And it’s a good thing it isn’t anything more than that, otherwise us coders would be out of the job haha!

2 Likes

ChatGPT is sometimes able to give you a good and straight answer, but sometimes if you ask it to do something, it will make things up. I have seen this happen on multiple occasions, where it failed to correctly determine that a value was greater than a different value, and returned FALSE on a clearly true operation.

Correcting it may help it get back onto the right track, but sometimes may be unreliable in some situations.

Example of faliure of a true function:
image

This has happened 2x while testing a EXP system for a upcoming game I am working on.

It’s ugly code in my opinion. At least it follows some Lua style guidelines?

Good script in my opinion. Didn’t even know you could do this with ChatGPT, this is awesome.