You do you, but I guess I would add a print function.
Wait a minute…
Try using a remote event?
-- server script, inside the click detector
local clickDetector = script.Parent
local remoteEvent = game.ReplicatedStorage.RemoteEvent -- insert a remote event into replicatedStorage.
clickDetector.MouseClick:Connect(function(player) -- the player that clicked it
remoteEvent:FireClient(player) -- fires the client, which is the player.
end)
-- a local script, inside the frame.
local remoteEvent = game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvent")
-- gets the remote event
remoteEvent.OnClientEvent:Connect(function()
print("Hello! This event has been fired!")
-- code to tween the frame.
end)
I just have 2 questions:
When I made it visible/invisible it worked and when I made it tween it dosent, why not?
Q2: I set the position to 0.5,0, 0.5,0 and anchorpoint to 0.5,0.5 but its not centered. Why?
{0, something}
0 is the scale value, while something is the offset value.
If it is true, then the frame’s size might not be centered.
Try converting it to Scale {something, 0}
something has to be between 0 and 1, though.
Here’s the code I would do, though:
-- put this code in the OnClientEvent
script.Parent:TweenPosition(UDim2.new(0.5, 0, 0.5, 0), Enum.EasingDirection.InOut, Enum.EasingStyle.Bounce, 3)
@akaSourDevIgnoreGuiInset only makes it so that it ignores the topbar space (if you had a frame with the size of 1,0, 1,0 and put ignore gui inset on, it would also cover the topbar (not the buttons))
Change your script to a ServerScript and set this (remember to follow the comments’ instructions):
local clickDetector = script.Parent; -- Reference your ClickDetector.
local function mouse_Click(player)
local playerGui = player.PlayerGui;
local tweenService = game:GetService("TweenService");
local tweenInfo = TweenInfo.new(
3,
Enum.EasingStyle.Bounce,
Enum.EasingDirection.InOut
)
local goal = {
UDim2.new(0.5, 0, 0.5, 0);
}
local targetUI = playerGui.ScreenGui.Frame; -- Reference your UI.
local finalTween = tweenService:Create(targetUI, tweenInfo, goal)
finalTween:Play()
end
clickDetector.MouseClick:Connect(mouse_Click)
It enables the UI from another client considering it’s a LocalScript, not on the client of the player who clicked it. The script runs perfectly but not on the client of the player who clicked it.