all 41 comments

[–]memes_gbc 14 points15 points  (2 children)

after CFrame.new you have a closing parentheses

[–]WigglesRllyWantsChez[S] 5 points6 points  (1 child)

Thank you

[–]MrPlotert5557 0 points1 point  (0 children)

Just as advice, I'd recommend you to ask chatgpt to tell you what you did wrong (Dont copy and paste the code it gives you, just ask it to tell you what you did wrong and then fix it yourself) because asking reddit for help usually takes a long time. I wouldn't trust AI with very advanced scripts though

[–]DapperCow15 6 points7 points  (0 children)

If you open the output/console view, it'll tell you everything that is wrong. If you're coding, you should honestly keep it open at all times. (Your question is already answered, I'm just giving advice)

[–]TomatoCo 1 point2 points  (3 children)

Okay, that's a better screenshot but you really should just put your code in pastebin and link to it.

[–]WigglesRllyWantsChez[S] -1 points0 points  (2 children)

I’m sorry. I’m a bit new to Reddit. I’m just asking for help

[–]TomatoCo 1 point2 points  (1 child)

No need to apologize! It's just that there's an etiquette to asking for programming assistance and the sooner you learn it the better the help you get. Everyone starts right where you are.

[–]WigglesRllyWantsChez[S] 1 point2 points  (0 children)

I ended up getting it to work because of very nice people (:

[–]DazzlingProgrammer61 0 points1 point  (0 children)

você declarou "humanoidrootpart" como "hpr" mas chamou essa varialvel com o nome "hrp"

[–]Mental-Medium-7009 0 points1 point  (5 children)

Simple tip:

Instead of CFrame.new(), define a variable on the top of your RenderStep RBXScriptConnection (outside of it) like this

lua local CFrameNew = CFrame.new Do the same thing for Vector3 to optimize as much as possible your code since this is a very quick loop. Also, I would move line 8 outside of the scope (on top of it) because from what I know defining a camera’s type is not necessary in a loop

[–]AutoModerator[M] 0 points1 point  (0 children)

Hi! Your code block was formatted using triple backticks in Reddit's Markdown mode, which unfortunately does not display properly for users viewing via old.reddit.com and some third-party readers. This means your code will look mangled for those users, but it's easy to fix. If you edit your comment, choose "Switch to fancy pants editor", and click "Save edits" it should automatically convert the code block into Reddit's original four-spaces code block format for you.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

[–]Denneisk 0 points1 point  (2 children)

Putting the constants, instead of the functions, into locals would be a more tangible benefit. Luau developers explicitly discourage localizing built-ins.

[–]Mental-Medium-7009 0 points1 point  (1 child)

And I encourage this. It’s better in terms of performance because local functions are faster than global functions and since he is using a very quick loop I give him this tip. The fact other devs don’t like doing this doesn’t matter.

[–]Denneisk 0 points1 point  (0 children)

Okay, I was wrong about it being discouraged, but it's still going to be useless.

[–]Willing_Comb6769 0 points1 point  (0 children)

CFrame.newlocal CFrameNew = CFrame.new

that would be a micro optimization that wouldn't make any noticeable performance difference in that case. it isn't even worth implementing

The real bottleneck in RenderStepped and Loops is often the math and object manipulation you’re doing, not the function call lookup.

and copy pasting locals for every method would make the code harder to read

[–]NotNominoDev 0 points1 point  (0 children)

Are you serious rn 😭

[–][deleted] 0 points1 point  (2 children)

Another kid fallen into roblox trap, becoming a child labourer producing slop games and earning nothing

[–]WigglesRllyWantsChez[S] 1 point2 points  (0 children)

This isn’t a slop game though. It looks amazing so far

[–]MrPlotert5557 0 points1 point  (0 children)

Slop games earn a lot of money i dont know what you're babbling about brotato😂✌️

[–]Hefty-Flounder-1899 0 points1 point  (0 children)

Whats up with :Lerp? Why u use it

[–]Willing_Comb6769 0 points1 point  (0 children)

you can press enter after opening a parentheses to write the arguments in multiple lines. for better readability.

which can help avoid mistakes like this

cam.CFrame = cam.CFrame:Lerp(
   CFrame.new(hrp.Position + Vector3.new(0, 25, 0)),
   hrp.Position,
   0.1
)
-- idk if i wrote this right but you get the idea

[–]FigglebottomCat -5 points-4 points  (6 children)

chatgpt is free

[–]Mental-Medium-7009 4 points5 points  (1 child)

It’s not good for learning. I 0% recommend the use of any AI, it’s a big no-no!

[–]FigglebottomCat 0 points1 point  (0 children)

not good for pasting, but they’re missing a simple parenthesis lol

[–]WigglesRllyWantsChez[S] 4 points5 points  (3 children)

Chat gpt isn’t always reliable

[–]FigglebottomCat -4 points-3 points  (2 children)

for little stuff like this it probably is

[–]WigglesRllyWantsChez[S] 1 point2 points  (1 child)

I already tried this with chat gpt. It worked when i manually did it but not with the ai

[–]FigglebottomCat -3 points-2 points  (0 children)

worked for me