#How to make a "Gui Effect" (When clicked it has a bounce effect)

258 messages · Page 1 of 1 (latest)

whole salmon
#

Need to have a sort of "bounce"

cerulean jetty
#

TweenService

whole salmon
#

i dk how to script

cerulean jetty
whole salmon
#

been tryin for 3 days

#

cant figure out a script

#

that works

cerulean jetty
#

Have you tried using the "brain", whatever that might be?

whole salmon
#

):

pine field
whole salmon
#

:C

pine field
#

This is a help channel you don’t ask for people to code your games here

whole salmon
#

Ye

#

ik

whole salmon
#

@pine field @cerulean jetty ok so

#
local btn = script.Parent

local isHovering = false


btn.MouseEnter:Connect(function()
    
    isHovering = true
    
    btn:TweenSize(UDim2.new(0.65, 0,0.22, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 0.2, true)
end)

btn.MouseLeave:Connect(function()
    
    isHovering = false
    
    btn:TweenSize(UDim2.new(0.63, 0,0.204, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 0.2, true)
end)

btn.MouseButton1Down:Connect(function()
    
    btn:TweenSize(UDim2.new(0.65, 0,0.22, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 0.2, true)
end)

btn.MouseButton1Up:Connect(function()
    
    if not isHovering then
        btn:TweenSize(UDim2.new(0.63, 0,0.204, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 0.2, true)
    else
        btn:TweenSize(UDim2.new(0.63, 0,0.204, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 0.2, true)
    end
end)
#

I changed sizes n stuff

#

but like

#

when I click the button

#

it does this

cerulean jetty
#

Um..... what the heck is this?

whole salmon
#

only effects 1 corner

shrewd waveBOT
#

studio** You are now Level 5! **studio

whole salmon
#

?

#

what

pine field
#

Good luck with it though

whole salmon
#

a ok

#

rn im working to see

#

how tween service works

pine field
cerulean jetty
#
local TweenService = game:GetService("TweenService")
local button = script.Parent

local tInfo = TweenInfo.new(0.5, Enum.EasingStyle.Quint)

local tweenEnter = TweenService:Create(button, tInfo, {Size = Udim2.new(x1, 0, y1, 0)})
local tweenLeave = TweenService:Create(button, tInfo, {Size = Udim2.new(x2, 0, y2, 0)})

button.MouseEnter:Connect(function()
  tweenEnter:Play()
end)

button.MouseLeave:Connect(function()
  tweenLeave:Play()
end)

This should work... I've never seen a script like yours

whole salmon
#

oh

#

💀

cerulean jetty
#

You might need to add a debounce

whole salmon
cerulean jetty
#

A checker

whole salmon
#

to check what

cerulean jetty
#

nvm

whole salmon
#
local TweenService = game:GetService("TweenService")
local button = script.Parent

local tInfo = TweenInfo.new(0.5, Enum.EasingStyle.Quint)

local tweenEnter = TweenService:Create(button, tInfo, {Size = Udim2.new(x1, 0, y1, 0)})
local tweenLeave = TweenService:Create(button, tInfo, {Size = Udim2.new(x2, 0, y2, 0)})

button.MouseEnter:Connect(function()
  tweenEnter:Play()
end)

button.MouseLeave:Connect(function()
  tweenLeave:Play()
end)
#

doesnt work

#

hold on

#

lemme fix smth

cerulean jetty
pine field
#

Or whenever you don’t want it to

whole salmon
#

this one doesn't work tho

cerulean jetty
#

Im 99% sure you didnt even changed x1, x2, y1 and y2 xD

whole salmon
#

I did..

cerulean jetty
#

UDim2

#

My bad, I write it in Discord

pine field
#

Vector3?

whole salmon
#

huh\

cerulean jetty
#

But still, that should be a pretty easy-to-fix mistake

cerulean jetty
whole salmon
#

yeah

pine field
whole salmon
#
local TweenService = game:GetService("TweenService")
local button = script.Parent

local tInfo = TweenInfo.new(0.5, Enum.EasingStyle.Quint)

local tweenEnter = TweenService:Create(button, tInfo, {Size = Udim2.new(0.65, 0,0.22, 0)
local tweenLeave = TweenService:Create(button, tInfo, {Size = Udim2.new(0.63, 0,0.204, 0)

button.MouseEnter:Connect(function()
    tweenEnter:Play()
end)

button.MouseLeave:Connect(function()
    tweenLeave:Play()
end)
cerulean jetty
#

Change "Udim2" to "UDim2"

whole salmon
#

fixed.

#

didnt realize that at first

#

now what

cerulean jetty
whole salmon
#

hm

pine field
# cerulean jetty

New scripters watching their output box flooding with red text and being oblivious to what’s wrong

cerulean jetty
whole salmon
#

yes

#

i am dumb

cerulean jetty
# whole salmon

I swear, they should add a requirement to have some experience with scripting... At least knowing how to fix something like this...

whole salmon
cerulean jetty
#

API access

whole salmon
#

yeah

#

its enabled

cerulean jetty
#

Doesnt looks like

whole salmon
#

ok how to fix button

pine field
# whole salmon i am dumb

Hey it’s better to humiliate yourself a bit so you can learn rather than not and being dumb for life

whole salmon
#

ima fix the button

#

dont tell me

#

i got this.

cerulean jetty
#

Hint: hover your mouse over the red line

#

Hint 2: think hollow

pine field
#

The output should give you a good idea of what’s wrong with your code too

#

Troubleshooting 101 hollow

whole salmon
cerulean jetty
#

Every scripter/programmer is

pine field
#

I’m assuming that because you’ve moved on to the gui now that you’ve already coded a big chunk of your game right?

pine field
#

Unless you made a toolbox dump game

cerulean jetty
#

kek good joke

whole salmon
#

somehow i'm the "scripter and gui maker"

cerulean jetty
whole salmon
#

its an obby..

#

wouldn't need toolbox crap

pine field
#

Nor any code lmao

whole salmon
pine field
#

Other than the occasional kill bricks and spinny parts

whole salmon
#

its an obby

#

but has other aspects to it

cerulean jetty
#

For an obby you literally need one script to save/load data and teleport player to checkpoint lol

whole salmon
#

obviously the obby parts itself don't need code

whole salmon
unreal matrix
#

i like men

shrewd waveBOT
#

studio** You are now Level 3! **studio

cerulean jetty
#

3 lines of code gigachad

whole salmon
#

yeah

pine field
whole salmon
#

only thing I can script

#

!

cerulean jetty
unreal matrix
whole salmon
#

Ok

#

anyways pls help fortnite

cerulean jetty
fiery sierra
whole salmon
#

?

#

Ok

unreal matrix
whole salmon
#

guys i mscared

#

plsss

unreal matrix
#

bro

#

button is nil

whole salmon
#

ye

cerulean jetty
unreal matrix
#

do

local button = script.Parent --or idk
whole salmon
#
local TweenService = game:GetService("TweenService")
local button = script.Parent

local tInfo = TweenInfo.new(0.5, Enum.EasingStyle.Quint)

local tweenEnter = TweenService:Create(button, tInfo, {Size = UDim2.new(0.65, 0,0.22, 0)
local tweenLeave = TweenService:Create(button, tInfo, {Size = UDim2.new(0.63, 0,0.204, 0)

button.MouseEnter:Connect(function()
    tweenEnter:Play()
end)

button.MouseLeave:Connect(function()
    tweenLeave:Play()
end)
cerulean jetty
unreal matrix
cerulean jetty
#
local tweenEnter = TweenService:Create(button, tInfo, {Size = UDim2.new(0.65, 0,0.22, 0)})
local tweenLeave = TweenService:Create(button, tInfo, {Size = UDim2.new(0.63, 0,0.204, 0)})
#

This should fix it

unreal matrix
#

yea

#

100%

whole salmon
#

yeah

#

fixed

#

but

cerulean jetty
whole salmon
cerulean jetty
#

First I though it was my typo...

pine field
whole salmon
#

look

unreal matrix
whole salmon
#

wait

#

join general 1 rq

#

ssing on my microwave

#

cuz my pc is making toast

#

but look

#

ples

#

you can see

cerulean jetty
#

You also need to change position

whole salmon
#

@cerulean jetty wym

cerulean jetty
#

So it can be centered every time

#

OR

whole salmon
#

yeah

cerulean jetty
#

Use a UIListLayout

whole salmon
unreal matrix
#

:3

whole salmon
#

works?

cerulean jetty
#

Idk we can't see explorer and properties

unreal matrix
#

how to show screen

whole salmon
#

oh

#

wait

unreal matrix
#

bruh

whole salmon
#

hb now

cerulean jetty
#

working

#

test

#

Show the UIListLayout prop

whole salmon
cerulean jetty
#

Vertical
Center
LayoutOrder
Center

#

test now

whole salmon
#

alright

#

So is it right now?

#

it seems its only going up

cerulean jetty
#

Yea, you just need to add a little bit more to X axe

whole salmon
#

I need it

#

to go

#

in

#

so ill change it

#

rq

#

hope I don't screw up anythin

cerulean jetty
#

wait

whole salmon
#

ye

cerulean jetty
#

just play with the values now

whole salmon
#

that seems to be good

#

but now what about

#

when I

#

"click"

#

on it

shrewd waveBOT
#

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

cerulean jetty
#
button.MouseButton1Click:Connect(function()
  print("click")
end)

whole salmon
#

where would I add it

cerulean jetty
whole salmon
#

yes

pine field
#

Can you send whole sentences please you keep reminding me of my dumbass airhead classmate who breaks up his sentences into multiple messages in the fucking class whatsapp gc and it's so goddamn annoying

cerulean jetty
#

literally anywhere

whole salmon
#

ok

whole salmon
#

never heard of anyone doing that in my school

pine field
whole salmon
cerulean jetty
#

test it now

#

Open the output

#

Anything else?

whole salmon
#

when I hover

#

nvm

#

bro wtf

#

my msgs so slow

#

anyways thanks so much

#

I am stupid

pine field
#

For the ragdoll script I would add a
Character.Head.CanCollide = on
or something like that for each part

whole salmon
#

I think we made it so the head isn't collided

#

he made it

#

no idea tf he did

#

lemme check

pine field
#

I thought I was going insane but when I was making a ragdoll script I was like why tf can't the head collide

#

You have to type that in somewhere

#

Don't copy and paste it because I'm 40% certain it would work

whole salmon
#

let me just show the script

#

ragdoll one

pine field
whole salmon
#

alright

#

anyways heres the script

pine field
#

Torn from my game that I won't finish because I was way too ambitious

whole salmon
#
local char = script.Parent
local hum = char:WaitForChild("Humanoid")

hum.BreakJointsOnDeath = false

hum.Died:Connect(function()
    local joints = char:GetDescendants()
    for _,joint in pairs(joints) do
        if joint:isA("Motor6D") then
            local socket = Instance.new("BallSocketConstraint", joint.Parent)
            local a0 = Instance.new("Attachment")
            local a1 = Instance.new("Attachment")

            socket.Attachment0 = a0
            socket.Attachment1 = a1

            a0.Parent = joint.Part0
            a1.Parent = joint.Part1

            a0.CFrame = joint.C0
            a1.CFrame = joint.C1

            socket.LimitsEnabled = true
            socket.TwistLimitsEnabled = true

            joint:Destroy()
        end
    end
end)```
whole salmon
pine field
#

GTA online clone lmao

whole salmon
#

LOL

#

ngl that would be a decent game

#

unless its like

pine field
#

It's a cool game as it is with a working heist but I wouldn't release it

whole salmon
#

a direct 1-1 copy

pine field
whole salmon
#

I never played it before

#

but I seen game play

pine field
#

Lemme plug my laptop in and find the code real quick

whole salmon
#

check dm

pine field
# whole salmon I never played it before

I grinded to get the anti air missile launcher to fend off against dipshits riding those flying motorcycles, once I thought I had an unsuspecting predator ready to experience karma the missile missed by a mile because the tracking on it sucks ass

pine field
#

I was expecting an epic comeback and all I got was a crappy overpriced firework show and a missile of their own to my face

pine field