#did i do something wrong?

1 messages · Page 1 of 1 (latest)

drowsy jasper
#

the click function refuses to work even if i click on it.

pastel merlin
scarlet spindleBOT
#

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

pastel merlin
#

First, you don't need a click detector in a gui button, which I'm not sure why you're defining a variable for one when you don't even use "click" through the whole thing lol.

Second, local scripts (which this is) can't access the ServerStorage service, which I'm also not sure why you make a variable for since it also isn't referenced.

Third, if the script is in a gui, then you don't need to go all the way through getting the PlayerGui object, since you can just navigate through the button's ancestry (.Parent).

Fourth, you define the player and playerscreen variable twice (though it's not needed at all).

Fifth, you define an unnecessary remote event since that also isn't used. (You actually define this remote event in two different variables lol)

#

Also, can you show a picture of the output?

#

@drowsy jasper

drowsy jasper
pastel merlin
#

That

drowsy jasper
#

its connected to a part

pastel merlin
#

Welp

#

I guess I gotta make another list lol

drowsy jasper
#

im sorry 🙁

pastel merlin
#

Most of the things in the first list are still valid btw

#

Alright, list #2:

First, local scripts don't work within the workspace outside of the player character, so you need to switch it to a normal script.

Second, refer back to the variable problems and the remote event problem in the first list lol.

Third, you use the button part's variable instead of the click detector for the mouseclick connection. it should be click.MouseClick instead.

Fourth, you won't be able to use local player to get the gui since you'll need to change to a normal script, but don't worry since that "ply" in the mouse click thing refers to the player who clicked the click detector, so you can put a variable in the event function that is the player, and get their gui from there. EX: function event(player).

drowsy jasper
#

it doesnt work even with click

pastel merlin
#

It won't until the other fixes are implemented as well

#

The most important is that it needs to be a normal script and not a local script, as well as removing the things that will throw an error and abort the script

drowsy jasper
pastel merlin
#

Oh, there's definitely logic errors in there lol

drowsy jasper
#

i think i can fix it on my own

#

ill say something if i hit another road block

pastel merlin
#

Well, if you can't get it to work, then here's a script for it that should work.

local clickDetector = script.Parent.ClickDetector

function event(player)
    local gui = player.PlayerGui
    local screenGui = gui.ScreenGui
    local frame = screenGui.Frame
    
    local TS = game:GetService("TweenService")
    
    local tweenInfo = TweenInfo.new(2, Enum.EasingStyle.Sine, Enum.EasingDirection.InOut)
    local newTween = TS:Create(frame, tweenInfo, {BackgroundTransparency = 0})
    newTween:Play()
    
    print("Activated")
end

clickDetector.MouseClick:Connect(event)
drowsy jasper
#

i didnt know you can do that with the MouseClick function.

#

thank you so much

#

ok this is what i did

pastel merlin
drowsy jasper
#

yep

pastel merlin
#

Nice

drowsy jasper
#

the remote stuff was left over from something else btw