#did i do something wrong?
1 messages · Page 1 of 1 (latest)
There's quite a bit wrong with this. Give me a sec while I make a list on how to correct them
damn...
** You are now Level 3! **
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
ok but first im not using a gui button
That
its connected to a part
im sorry 🙁
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).
it doesnt work even with click
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
i think i tried that before but ill try it again to see if it was an logic error.
Oh, there's definitely logic errors in there lol
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)
i didnt know you can do that with the MouseClick function.
thank you so much
ok this is what i did
Is it working?
yep
Nice
the remote stuff was left over from something else btw