#I need help, i want to create my first easy script, i'm a begginer and i need ideas!

354 messages · Page 1 of 1 (latest)

uncut badge
#

I need help, i want to create my first easy script, i'm a begginer and i need ideas!

#

any ideas?

vague fossil
#

Elevator system

whole leaf
#

Elevator system

uncut badge
#

wow

#

ok

#

elevator system

vague fossil
#

Yh should wrap up all basics and fundamentals

uncut badge
#

how can i start

#

YES

prisma terrace
#

nice english

uncut badge
#

i

#

i understand it now.

vague fossil
uncut badge
#

alr

vague fossil
#

Then add a button

viral hatch
uncut badge
#

no

vague fossil
uncut badge
#

ok

#

should i use moveto?

vague fossil
uncut badge
#

that's the point

#

😼

vague fossil
#

Then start by learning programming basics

uncut badge
#

OK

#

YALL

#

I SHOULD START

plain zealot
uncut badge
#

CREATING THE MODEL

#

RIGHT?

vague fossil
#

Jus do some simple sh bro

prisma terrace
#

it's s4

prisma terrace
vague fossil
#

My first project was an elevator system

#

It just was few parts piled up

uncut badge
#

alr

vague fossil
#

Nun much

uncut badge
#

lets start

#

my model will be an part

#

watchiing

vague fossil
uncut badge
#

YES

#

YES MASTER

vague fossil
uncut badge
#

this is peak

#

i understand it

#

so

#

lets say

vague fossil
#

Go learning programming basics first

#

As u learn write ur elevator system

uncut badge
#

A = 300 and B = 500

#

so

vague fossil
#

Use the roblox documentation for classes and other stuff

uncut badge
#

ok

#

i need it

#

where's it

vague fossil
uncut badge
#

WAIT

#

i can do

#

an simple script

vague fossil
uncut badge
#

olk

#

@stark bough

#

yall

#

join general 1?

#

i want to screen share

#

😰

vague fossil
#

I mean if u knew few programming basics u could do this in less than a day

vague fossil
#

Learning zig rn

uncut badge
#

i did this simple script

#

will it work?

vague fossil
#

Yes

#

And

#

Use task.wait

uncut badge
#

oh

#

why?

vague fossil
#

Its overall more precise

uncut badge
#

oh

#

alr

#

i'm going to check if it works

#

it works

#

yay

vague fossil
#

👍

uncut badge
#

@vague fossil

royal breachBOT
#

studio** You are now Level 7! **studio

uncut badge
#

i did this

#

is it going to work?

#

where

#

WOW

#

why?

#

what's the difference?

#

it worked

#

danm

#

thanks

#

is it easy to learn

#

?

#

alr

#

where i can

#

learn it

plain zealot
uncut badge
#

OH

#

really?

#

i didn't know that

#

danm

#

thanks

#

ok

#

how can i move parts

#

like

#

i mean

#

what can be used to move parts

#

should i use MoveTo?

spice flame
#

Part.Position = Vector3.new(x , y , z)

uncut badge
vague fossil
#

no

uncut badge
#

guys

#

how can i repeat an script

#

like

#

make it repeat

vague fossil
#

wdym

#

like repeat whats inside

#

u can use loops

#

check this out

uncut badge
#

oh

#

loopos

vague fossil
#

yup

vague fossil
#

u will find also few simple projects u can make

uncut badge
#

I DID IT

#

it worked

vague fossil
uncut badge
#

wait

#

@vague fossil

#

this is the code

#

it makes the part move

#

down and up

fair turret
#

make a smooth movement

uncut badge
#

yes

#

how

vague fossil
#

to make a smooth movement

fair turret
#

for loops

vague fossil
#

theres a built in function called lerp

#

or u can use tweening

#

or

#

u can use for loops

uncut badge
#

i mean

#

how do i make smooth move

#

like

#

make it move smooth

vague fossil
#

the 3 methods i said

uncut badge
#

i don't want to do loops

fair turret
#

while true do
for i = 1, 100 do
wait(0.1)
part.Position += Vector3.new(0,0.1,0)
end
for i = 1, 100 do
wait(0.1)
part.Position += Vector3.new(0,-0.1,0)
end

end

#

try this

uncut badge
#

what does that makes

vague fossil
fair turret
#

smothly pushes it

vague fossil
#

also learn about cframes

fair turret
#

not sure if its to fast tho

vague fossil
uncut badge
#

can this work?

#

@vague fossil

vague fossil
#

u forgot to close the parenthesis

#

everytime u open one u have to close it

uncut badge
#

where

vague fossil
#

also lerp takes a second parameter

uncut badge
#

like this?

vague fossil
#

yes

uncut badge
#

o

vague fossil
uncut badge
vague fossil
uncut badge
#

how do i fix this

vague fossil
#

u need a second parameter

uncut badge
#

this white hing

#

thing

#

when i write

#

it's making me miss

vague fossil
#

its nothing wrong

#

its a block cursor

uncut badge
#

how do i remove it

vague fossil
#

im pretty sure u can change it somewhere in settings

#

just consider the left side of the square

uncut badge
#

i'm talking about the white thing on wait(2)

vague fossil
#

yeah the block thingy

#

?

uncut badge
#

yes

#

look

#

when i click

#

it happens

vague fossil
#

yeah thats ur cursor

uncut badge
#

no

vague fossil
#

yes

uncut badge
#

my cursor is an arrow

#

what

#

and how do i remove it

vague fossil
#

i meant ur cursor in the text editor

#

u see i have it there too

vague fossil
#

it indicates where ur gonna type, select, delete and so on

#

u can move it around

#

by clicking around the editor

#

or with arrow keys

uncut badge
#

alr

#

thanks

#

now

#

what i have to do?

#

i did lerp (goal

vague fossil
#

goal should be a cframe

uncut badge
#

@vague fossil

#

what

#

how

#

do i have to do goal: Cframe

#

@vague fossil

fair turret
#

brother u said u need help. while hes doing the entire script

uncut badge
fair turret
#

then what u did by yourself?

uncut badge
#

some parts of the script

#

i understand a bit of scripting

#

but i don't understand lerp

#

that's why i'm asking for zeroo's help

fair turret
#

he explained like 200 times

#

the first parameter

#

askf fora a cframe

#

second ask for a number throught 0.1 , 1

uncut badge
#

what the hell is an parameter

fair turret
#

if im not wrong

fair turret
#

after the Lerp

uncut badge
#

goal asks for an cframe?

fair turret
#

ye

#

first u put a cframe

#

and then a then a number 1

#

so (CFrame.new(0,10,0), 1)

uncut badge
#

so

#

cframe

#

is like

#

vector 3?

#

wdym with the number 1

#

what does the number 1 do

fair turret
#

if u put 0.5 it only goes halfway

#

not used it in a long time but i think thats what it does

uncut badge
#

oh

#

OH

#

help

#

@uncut badge

#

wtf i pinged myself lol

#

@fair turret

fair turret
#

remove one ()

#

CFrame.new(0,0,0), 1)

#

like this

uncut badge
#

like this?

#

@fair turret help 😭

fair turret
#

remove the goal thingy

uncut badge
#

ok

#

ok

#

what now

fair turret
#

and the :

uncut badge
#

@fair turret i did this

#

local part = game.Workspace:WaitForChild("Part")
local goal = 1

while true do
part.Anchored = true
part.CFrame = part.CFrame:Lerp(CFrame.new(0, 10, 0), goal)
wait(2)
part.CFrame = part.CFrame:Lerp(CFrame.new(0, 0, 0), goal)
wait(2)
end

fair turret
#

should work

uncut badge
#

but

#

is the move smooth?

#

it just teleports

fair turret
#

smooth

uncut badge
#

it's not to

#

it's just teleporting

fair turret
#

wait a sec

uncut badge
#

i guess i will have to use tweenservice

uncut badge
#

@fair turret

royal breachBOT
#

studio** You are now Level 8! **studio

uncut badge
#

fixed

#

local TweenService = game:GetService("TweenService")
local part = game.Workspace:WaitForChild("Part")

while true do
local goalUp = {}
goalUp.Position = Vector3.new(0, 10, 0) -- Define o objetivo para cima

local TweenInfoUp = TweenInfo.new(0.5)   -- Duração do tween para cima
local TweenUp = TweenService:Create(part, TweenInfoUp, goalUp)

TweenUp:Play()  -- Reproduz o tween para cima
TweenUp.Completed:Wait()  -- Aguarda até que o tween para cima termine

local goalDown = {}
goalDown.Position = Vector3.new(0, 0, 0)  -- Define o objetivo para baixo

local TweenInfoDown = TweenInfo.new(0.5)  -- Duração do tween para baixo
local TweenDown = TweenService:Create(part, TweenInfoDown, goalDown)

TweenDown:Play()  -- Reproduz o tween para baixo
TweenDown.Completed:Wait()  -- Aguarda até que o tween para baixo termine

end

uncut badge
#

it works

#

but

#

there's some problems

#

i tried to fix

nimble flax
vague fossil
#

if u want it smooth

uncut badge
nimble flax
#

so

#

the way lerp works

#

is

#

you need your part

#

that you want to move

#

/anything

#

then you want 2 cframes

#

so

#

it calculates

#

all the positions in between part 2 and 3

#

and you can access

#

those cframes

#

by setting the alpha

#

a value which is 0-1

#

so like a percentage

#

lemme give an example script

#
local part1 = --part you want to move
local part2 = --start point
local part3 = --end point

for i = 0, 1, 0.01 do -- 0, 1 (this sets the start point and end point of this for loop), 0.01 (this is the step it takes every time it goes through the for loop till it reaches 1 so , 0.01, 0.02)
    part1.CFrame = part2:Lerp(part3.CFrame, i) -- it makes the CFrame to i as the alpha
    task.wait()
end

#

like the alpha think of it as a percentage

viral hatch
nimble flax
#

oh yeah

#

he didn't put in a for loop

#

Oopd

viral hatch
#

Yeah

nimble flax
#

my mistake

#

but

#

what I said

#

earlier

#

is necessary

uncut badge
#

yo

#

@vague fossil

vague fossil
#

yo mate

#

@uncut badge

#

sorry for the late reply

#

was busy studying

#

u need sum?

vague fossil
#

the goal is the cframe

uncut badge
#

mb

viral hatch
#

Look at their screenshot

#

They made a VARIABLE named goal and set it as 1 for the alpha

#

Lol

vague fossil
#

ohh mb

viral hatch
#

You good

vague fossil
#

they jus confused the name of the variable

#

overall its still the same tho no

#

?

#

yh

viral hatch