#Making clouds bounce and learning tweenservice

1524 messages · Page 2 of 2 (latest)

crisp raft
#

Smoke is parent

sterile crater
#

the parent of that script is Smoke

crisp raft
#

to the script

sterile crater
#

and the child of Smoke is the script

#

yes

crisp raft
#

and workplace is the parent of smoke

sterile crater
#

yes

#

and os on

#

so on

#

until no Parent

#

moving on

#

back to soundFire

#

wait

#

did you redefine the local sound

crisp raft
#

Yes

sterile crater
#

in the first part code

#

ok

crisp raft
#

in the other script

#

yes

sterile crater
#

ok

#

now

#

function

#

you passed info

#

from part 1

#

to part 2

#

now part 2 knows what sound you want to play

crisp raft
#

yes

sterile crater
#

you have to play it now

#

so play it

#

now.

crisp raft
#

sound:Play ()?

sterile crater
#

explain yourself

#

why space

#

why you want to seperate them man

#

what did they do

#

to you

crisp raft
#

accident

#

Sound:Play()

sterile crater
#

no men

#

that was no accident

#

fully intentional

#

smh

crisp raft
#

😭

sterile crater
#

ok

#

but

#

what is Soun

#

Sound

#

in part 2 there is no variable

#

named Sound

crisp raft
#

Sound is the info from the fire event

#

OH

sterile crater
#

hopefully

crisp raft
#

local Sound = game.ReplicatedStorage.Sounds.BoingSound

#

wait isn't that

sterile crater
#

NO MEN

crisp raft
#

NO

#

OK

sterile crater
#

WHAT 2 PIECES

#

of info do you send from part 1 to part 2

crisp raft
#

SoundObject:Play()

sterile crater
#

YES

crisp raft
#

OK

sterile crater
#

now play

#

and be amazed

crisp raft
#

ok ill send a clip

sterile pilotBOT
#

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

crisp raft
#

gimmie a sec

#

well

#

one sec

#

sent in wmv

#

@sterile crater It works!!!!!

#

that was the wrong clip!!!

sterile crater
#

ok it works

#

now

#

tell me

crisp raft
sterile crater
#

@crisp raft are you ready?

crisp raft
#

i think i need

#

to add a wait

sterile crater
#

yes

#

debounce

crisp raft
#

before the next sound

sterile crater
#

aka cooldown

crisp raft
#

what is debounce

sterile crater
#

COOLDOWN

crisp raft
#

how does that work

sterile crater
#

you say

#

no cooldown

#

you toucjh

#

you give cooldown

#

you wait

#

you say no morec ooldown

#

you can touch

crisp raft
#

so task.wait(.5)

#

or is it not the same

sterile crater
#

nonono

crisp raft
#

task.wait makes the current task pause

#

its not a cooldown

#

i see

sterile crater
crisp raft
#

this

#

local deb = false
while wait() do
if not deb then
deb = true
-- stuff
wait(1)
deb = false
end
end

#

doesn't make sense

sterile crater
#

task.wait will simply wait the specified amount of time and after that continue the code

#

go further down

#

to the user Cairo

#

his explanation is readable

crisp raft
crisp raft
#

now i need to make Debounce trigger

sterile crater
#
local Debounce = false -- Our Debounce Variable

local DelayTime = 1 -- Our Delay time

function DebounceExample ()
if not Debounce then -- Checks if the Debounce is not equal to true (I believe)

Debounce = true -- Enables the Delay, function cant be used until false
print("Debounce Enabled")
task.wait(DelayTime) -- Wait time for delay
print("Debounce Disabled")
Debounce = false -- Disables Delay, Function can be used again

     end
end


while task.wait(Delaytime) do -- Example of a Debounce in a loop
DebounceExample()
end
crisp raft
#

So if not Debounce then at the start

sterile crater
#

basically

local onCooldown = false

--// you touch part
  onCooldown = true
  task.wait(5)
  onCooldown = false
crisp raft
#

of my function

#

ok ok

sterile crater
#

yes

crisp raft
#
local Remote = game:GetService("ReplicatedStorage"):WaitForChild("SoundPlayEvent")

local Sound = game.ReplicatedStorage.Sounds.BoingSound

local Debounce = false

local DelayTime = 0.5

function SoundFire(SoundName, SoundObject)
    if not Debounce then
    print(SoundName, SoundObject)
        SoundObject:Play()
        Debounce = true
        task.wait(0.5)
        Debounce = false
end

Remote.OnClientEvent:Connect(SoundFire)
sterile crater
#

yes men

#

but...

#

fix that indentation

#

nvm

#

its just discord

#

youre good

crisp raft
#

also

#

i have a new error

#

i didn't change

#

SoundFire so i don't understand

#

the error

sterile crater
#

Pynman

#

did you close the if statement with an end

#

and fix the indentation

#
if not Debounce then
print(SoundName, SoundObject)
#

in the same line level

#

just brings a tear to my eye

crisp raft
#

im so confused

#

wdym

sterile crater
#

which part

#

the tear part

#

or the end part

crisp raft
#

the end part

sterile crater
#

write me an if statement

#

right now

crisp raft
#

if not debounce then

sterile crater
#

anything

crisp raft
#

the rest of the script

sterile crater
#

write me a simple statement

#

which mentions that

#

if 1+1 = 2

#

then you print("Hi")

crisp raft
#
local a = 7
local result = 7 + 4

local function addSevenAnd4
  local result = 7 + 4
  if not Debounce then
  print(result)
end
merry valeBOT
#
Program Output
/opt/wandbox/lua-5.4.3/bin/lua: prog.lua:5: '(' expected near 'local'

merry valeBOT
#
Program Output
/opt/wandbox/lua-5.4.3/bin/lua: prog.lua:5: '(' expected near 'local'

crisp raft
#

what

#
local a = 7
while true do
    wait(2)

for a=7,10 do
    print(a) -- prints 10 times!)
    
end

-- addition
local function addThreeAndFour()
    local result = 3 + 4
    print(result)
end
-- calling the function with no return
addThreeAndFour() -- 3
print(a)
print(5+a)    
print(a+203+103)
merry valeBOT
#
Program Output
/opt/wandbox/lua-5.4.3/bin/lua: prog.lua:19: 'end' expected (to close 'while' at line 2) near <eof>

crisp raft
#

ok

crisp raft
#

i don't get it

sterile crater
#

pynman..

#

I am disappointed

crisp raft
#

i made those

sterile crater
#

I ASKED FOR A 1+1 = 2

#

I WANT A 1+1 = 2

crisp raft
#

a while ago

sterile crater
#

only then

crisp raft
#

when learning print

sterile crater
#

will I guide you further

#

give me a 1+1

crisp raft
#
local a = 1
local function math()
  local result = 1 + 1
  print(result)
end
merry valeBOT
#
crisp raft
#

ok

sterile crater
#

where the result at

#

I want my result

#

give me a result

#

now

crisp raft
#

I DONT KNOW

#

HOW DO I MAKE THE BOT WORK

sterile crater
#

YOU MADE THE FUNCTIOn

#

BUT DIDNT CALL THE FUNCTIOn

#

MAN

#

THIS FUNCTION IS FUNCTIONLESS

#

WITHOUT THE CALL

crisp raft
#

😭

sterile crater
#

CALL THE FUNCTION

crisp raft
#

OK

sterile crater
#

DIAL IT

crisp raft
#

local a = 1

local function mathskills()
  local result = 1 + 1
  print(result)
end

mathskills()
print(result)
merry valeBOT
#
Program Output
2
nil

crisp raft
#

@sterile crater

#

there

#

2

#

you got the result

sterile crater
#

disappointed in your for the nil

#

but I'll let it slide

#

now

#

tell me

#

what is wrong here

#
if not Debounce then
print(SoundName, SoundObject)
#

one word

#

is missing

#

every statement

#

and function

#

has the same word

#

at the end of the code

#

which closes the statement

crisp raft
#

but

#

if i end it

#

then the thing ends

sterile crater
#

the function you mean?

crisp raft
#
local Remote = game:GetService("ReplicatedStorage"):WaitForChild("SoundPlayEvent")

local Sound = game.ReplicatedStorage.Sounds.BoingSound

local Debounce = false

local DelayTime = 0.5

function SoundFire(SoundName, SoundObject)
    if not Debounce then end
        print(SoundName, SoundObject)
        SoundObject:Play()
        Debounce = true
        task.wait(0.5)
        Debounce = false
end

Remote.OnClientEvent:Connect(SoundFire)
sterile crater
#

nono my friend

#

you made big oopsie

#

why is end at the start

#

you want to execute everything past then

crisp raft
#

theres already an end

sterile crater
#

that's for the function

#

you also have an if statement

crisp raft
#
local Remote = game:GetService("ReplicatedStorage"):WaitForChild("SoundPlayEvent")

local Sound = game.ReplicatedStorage.Sounds.BoingSound

local Debounce = false

local DelayTime = 0.5

function SoundFire(SoundName, SoundObject)
    if not Debounce then
        print(SoundName, SoundObject)
        SoundObject:Play()
        Debounce = true
        task.wait(0.5)
        Debounce = false
end

    Remote.OnClientEvent:Connect(SoundFire)
    end
sterile crater
#

NO MEEEN

crisp raft
#

now there is no error

sterile crater
#

ok

#

we do this

crisp raft
#

we do this

sterile crater
#
local Debounce = false
if not Debounce then
    print("HI")
    Debounce = true


#

finish the code

crisp raft
#
local Remote = game:GetService("ReplicatedStorage"):WaitForChild("SoundPlayEvent")

local Sound = game.ReplicatedStorage.Sounds.BoingSound

local Debounce = false

local DelayTime = 0.5

function SoundFire(SoundName, SoundObject)
    if not Debounce then
        
    end
        print(SoundName, SoundObject)
        SoundObject:Play()
        Debounce = true
        task.wait(0.5)
        Debounce = false
end

Remote.OnClientEvent:Connect(SoundFire)
#

this happens

#

if i

#

press enter

sterile crater
#

👀

crisp raft
#

after the if statement

sterile crater
#

right

#

finish my code

#

now.

merry valeBOT
#
Program Output
/opt/wandbox/lua-5.4.3/bin/lua: prog.lua:1: attempt to index a nil value (global 'game')
stack traceback:
prog.lua:1: in main chunk
[C]: in ?

crisp raft
#

local Debounce = false
if not Debounce then
print("HI")
Debounce = true
end

sterile crater
#

yes

#

men

#

...

#

thats all you need

#

to close the statement

#

now

#

go back to the main code

#

and look

#

where you have to put the end

#

to close the if statement

crisp raft
#
local Remote = game:GetService("ReplicatedStorage"):WaitForChild("SoundPlayEvent")

local Sound = game.ReplicatedStorage.Sounds.BoingSound

local Debounce = false

local DelayTime = 0.5

function SoundFire(SoundName, SoundObject)
    if not Debounce then
        print(SoundName, SoundObject)
        SoundObject:Play()
        Debounce = true
        task.wait(0.5)
        Debounce = false
end
end

Remote.OnClientEvent:Connect(SoundFire)
#

THE IF STATEMENT IS THE FUNCTION

sterile crater
#

indentation

#

👀

#

I want to see one extra tab pressed

crisp raft
#
local Remote = game:GetService("ReplicatedStorage"):WaitForChild("SoundPlayEvent")

local Sound = game.ReplicatedStorage.Sounds.BoingSound

local Debounce = false

local DelayTime = 0.5

function SoundFire(SoundName, SoundObject)
    if not Debounce then
        print(SoundName, SoundObject)
        SoundObject:Play()
        Debounce = true
        task.wait(0.5)
        Debounce = false
    end
end

Remote.OnClientEvent:Connect(SoundFire)
sterile crater
#

in one line

#

yes

crisp raft
#

why does it end twice

#

😭

sterile crater
#

first you end the if statement

#

then you end the function

crisp raft
#

OH

sterile crater
#

gotta specify where things begin and where they end

#

this is called sytnax

#

syntax*

#

very fun stuff

crisp raft
#

I THINK I UNDERSTAND

sterile crater
#

absolutely torturing

crisp raft
#

IF YOU USE IF

#

YOU END TWICE

sterile crater
#

ONCE MEN

#

ONCE

#
if ... then
end
crisp raft
#

it worked

#

now

sterile crater
#
while true do
end```
crisp raft
#

delay on sound

sterile crater
#

yes

crisp raft
#

You could do the same thing with the bounce pad script

#

with speed also

#

couldn't you?

#

just replace the values with movespeed

sterile crater
#

if you want to give them a quick speed boost yes

#

it would be a bit different though

#

.Jump wouldn't be mentioned

#

aka forcefully making them jump

#

but

#

now

#

@crisp raft

#

are you ready

crisp raft
#

ready for what

sterile crater
#

learning tweenservice

#

what else

#

man

crisp raft
#

oh no

sterile crater
#

YES

crisp raft
#

can i get food first

sterile crater
#

no?

#

what kind of question is that

crisp raft
#

😭

#

ok

#

what next

sterile crater
#

ok

#

tweenservice

#

is very fun

bleak axle
#

damn bro

#

u still wanna do this

sterile crater
#

hey man

#

part1 is done

#

part 2 now continues

bleak axle
#

wow

#

👏🏻

sterile crater
crisp raft
sterile crater
#

tweenservice docs

#

now

#

you probably wont understand majority of it

#

so

#

ill dum it down

bleak axle
sterile crater
#

since I'd say tweenservice doesn't really have a definition

#

it's just tweenservice

#

the closest thing I'd call it is an Animator?

crisp raft
#

there is an evil alternative I will need to stay away from

#

chat gpt knows luau...

#

I WILL NOT

#

FALL TO THE TEMPTATION

#

I WILL LEARN

sterile crater
#

ok

crisp raft
#

i think

sterile crater
#

animates everything

#

basically

#

here is what it does

#

you specify a lot of indo

#

info*

#

but

#

the main 3 things you specify

crisp raft
#

will this be in the first script

sterile crater
#

uh

#

good question

#

do you want this to be seen

#

by everyone

crisp raft
#
local Remote = game:GetService("ReplicatedStorage"):WaitForChild("SoundPlayEvent")

local pad = script.Parent


local Sound = game.ReplicatedStorage.Sounds.BoingSound

function jump(hit)
    if hit.Parent:FindFirstChild("Humanoid") then
        local humanoid = hit.Parent:FindFirstChild("Humanoid")
        local player = game.Players:GetPlayerFromCharacter(humanoid.Parent)
        Remote:FireClient(player,"Sound",Sound)
        humanoid.JumpHeight = 100
        humanoid.Jump = true
        task.wait(.5)
        humanoid.JumpHeight = 7.2
    end
end

pad.Touched:Connect(jump)

#

this one

sterile crater
#

or just by the player

#

because of you want it to be seen by everyone we need to rework it completely

crisp raft
sterile crater
#

fun

#

ok so in the localscript

crisp raft
#

the audioplay script?

sterile crater
#

yh

bleak axle
#

uh sorry to interrupt, but radder the answer to my question in the post are module scripts?

sterile crater
#

nope

bleak axle
#

dang

sterile crater
#

module scripts make things more organised

#

but

#
  1. search up a tutorial on yt
#

for a simple fireball so you understand

#

the mechanics

#

of abilities

#

after that you should have somewhat of a clue on what to do

#

it's not that complicated

#

there's basically 2 big things involved and that's it

bleak axle
#

I mean the ability works perfectly fine and the cooldown works perfectly fine too. I want it to give a visible cooldown on a gui

#

and that's the problem

#

cause I try to somehow connect scs with startergui

sterile crater
#

you don't have to touch either one of them

bleak axle
#

wut

sterile crater
#

you haven't understood what either one of them are

#

whenever you launch the game right

bleak axle
#

ye

sterile crater
#

and your character gets created in game

bleak axle
#

yes

#

the things from the

#

scs

crisp raft
#

whilst you guys fix that im going to grab something to eat

#

brb

sterile crater
#

everything within StarterCharacterScritpts goes into the Humanoid

#

right

bleak axle
#

I know

sterile crater
#

it's a starter pack basically

#

a backpack

#

which EVERYONE gets

bleak axle
#

yes

sterile crater
#

same deal with startergui

#

99.99% of the time you don't mess with them

#

because they are the foundation

bleak axle
#

So how tf do I make it work

sterile crater
#

if you do it'll probably break the guis somehow

#

in your case

#

you're using a pre made module script

#

which is a pain

bleak axle
#

how

#

am I using a pre made

sterile crater
#

👀

#

cmon man

#

cmn

bleak axle
sterile crater
#

anyways

#

you just need to get into the LocalPlayer's PlayerGui and then into YourUi and update one of the element's text

#

simple stuff

#

, but since it's a module script

bleak axle
#

WTF

#

DOES IT EXIST

sterile crater
#

with stuff already going on in there

#

it's a bit harder

#

this is why using module scripts made by other people is a pain

#

you have to really understand what each line does

crisp raft
#

ok so @sterile crater I gotta go to town and stuff so ill prob be back on in a few hours idk if you will still be on so when i get more free time ill make a post on tween

sterile crater
#

WOW

crisp raft
#

thank you so much btw

sterile crater
#

no ill remember this

#

running away from tweenservice

crisp raft
#

im not

sterile crater
#

I hope it follows you in your nightmares

bleak axle
crisp raft
#

I SAID I WOULD BE BACK

sterile crater
#

nope

crisp raft
#

MAYBE EVEN TONIGHT IF I HAVE TIME

sterile crater
#

hope it haunts you

crisp raft
#

i will ping you when i make next post

sterile crater
#

👀

crisp raft
#

prob today

#

ty again

sterile crater
#

👍

bleak axle
#

so

#

radder

#

🥺

sterile crater
#

MAKE UR OWN STUFF MEN

#

no using module scripts

#

I don't even use them myself

bleak axle
#

I AM NOT ISKNG A MODUSSIOER

#

module script

sterile crater
#

WELL THEN LEARN ABILITIES

#

not a fun process

bleak axle
#

bro

sterile crater
#

VFX is a painful part

bleak axle
#

it's a local script in scs

#

and that's it

#

works like a charm

#

I ain't using no module script

sterile crater
#

ok

bleak axle
sterile crater
#
  1. where is the value
#

is it in a script

#

is it an object

#

intValue stringValue e.t.c

bleak axle
#

in scs

sterile crater
#

but what is it

#

the cooldown

#

or whatever

#

you want to display

#

on the screen

bleak axle
#

the cooldown is built in the script like

#

with functions

sterile crater
#

in the module script?

bleak axle
#

No

#

Omg

#

ok

#

so listen again

#

in scs

#

there is a folder

#

in that folder there is a local script

sterile crater
#

ok

bleak axle
#

which is the whole ability

#

and I want to somhow

sterile crater
#

ok then

#

create a screengui

bleak axle
#

yeah I have allat

sterile crater
#

create textlabel inside of the screengui

bleak axle
#

in starter gui

#

right

sterile crater
#

yes

local cooldown = 0
local player = game.Players.LocalPlayer

player.PlayerGui:WaitForChild("YourGuiName").TextLabel.Text = tostring(cooldown)
#

that's literally it

#

1 line

bleak axle
#

and this is a script inside...

#

a local script

sterile crater
#

of the same local script

bleak axle
#

inside

sterile crater
#

you use

bleak axle
#

oh

#

but look

sterile crater
#

the problem with this script is

#

you have to UPDATE THE VALUE

#

every single time it changes

bleak axle
#

ye

sterile crater
#

sio

#

you can do that in many ways

#

, but personally

#

I create a function

#

that is used every time the value changes

#

EXAMPLE:

bleak axle
#

so basically I tried doing that and when the script in scs changed the value in startergui the script in starter gui didn't want to see the change

sterile crater
#
local cooldown = 0
local player = game.Players.LocalPlayer
local function updateUI()
  player.PlayerGui:WaitForChild("YourGuiName").TextLabel.Text = tostring(cooldown)
end

cooldown += 1
task.spawn(function()
  repeat
    cooldown -= task.wait()
    updateUI()
    task.wait()
  until cooldown <= 0
end)
#
#

there's many ways to do this

#

MANY

bleak axle
#

ok I love u

#

thank you

bleak axle
sterile pilotBOT
#

studio** You are now Level 6! **studio

bleak axle
#

no matter what

sterile crater
#

the idea is the same

#

mess around with #1150694496292585472

#

if nothing helps

bleak axle
#

okay 👍🏻

#

so basically I was just messing around with startergui and not the playergui that shows up after the game starts

#

or myUi idk

#

u get the idea

sterile crater
#

messing with startergui is a rare thing which you really shouldn't be doing

#

unless you want to change some core element in the UI itself universally

#

, but if you do that you'll have to update all the live guis as well

#

which is just messy