Hey! I would like to make a Gui that activates with proximity prompt and with a tween effect but that it has a button to close it and that leaves with a tween effect I also always find tutorials that only activate the tween and after a few seconds it goes away, but not one that it goes away by pressing a button. Your help would be very useful!! :C
RemoteEvent
- ReplicatedStorage
Script
- workspace>Part>ProximityPrompt
LocalScript
- StarterGui>ScreenGui>Frame
LocalScript2
- StaterGui>ScreenGui>Frame>TextButton
Script
local RemoteEvent = game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvent")
local ProximityPrompt = script.Parent
local debounce = false
ProximityPrompt.Triggered:Connect(function()
if debounce == false then
debounce = true
RemoteEvent:FireClient()
else
debounce = false
end
end)
LocalScript
local RemoteEvent = game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvent")
local Frame = script.Parent
RemoteEvent.OnClientEvent:Connect(function()
Frame:TweenPosition(
UDim2.new(0.45, 0, 0.423, 0),
"Out", -- Select EasingDirection *1
"Quad", -- Select EasingStyle *1
1, -- Time (Seconds)
false
)
end)
LocalScript2
local TextButton = script.Parent
TextButton.MouseButton1Up:Connect(function()
Frame:TweenPosition(
UDim2.new(0.4, 0, 0.998, 0),
"In", -- Select EasingDirection *1
"Quad", -- Select EasingStyle *1
1, -- Time (Seconds)
false
)
end)
*1
https://create.roblox.com/docs/building-and-visuals/ui/ui-animations
WOW, Thanks but it gives me an error in Localscript2 I don’t know much about scripting so I don’t know what to do here help pls
Say Unknow Local ‘‘Frame’’ :C
BTW: You can edit the UI as you like, you can add any instance inside the frame. (TextLabel, TextButtons, ImageLabel, etc.)
Try this.
local TextButton = script.Parent
local Frame = TextButton.Parent
TextButton.MouseButton1Up:Connect(function()
Frame:TweenPosition(
UDim2.new(0.4, 0, 0.998, 0),
"In", -- Select EasingDirection *1
"Quad", -- Select EasingStyle *1
1, -- Time (Seconds)
false
)
end)
Thank you but something happened… apparently I tried to test this but nothing happened… not if I did something wrong but it just doesn’t work
is there any errors? can you show us ur explorer?
This is How Proximity Prompt Look
ScreenGui:
RemoteEvent:
literally didn’t change anything lol but still not working
send some screenshots and a video
he made an error in the Script
inside of the proximityprompt
change it to this:
local RemoteEvent = game:GetService("ReplicatedStorage"):WaitForChild("RemoteEvent")
local ProximityPrompt = script.Parent
local debounce = false
ProximityPrompt.Triggered:Connect(function(player)
if debounce == false then
debounce = true
RemoteEvent:FireClient(player)
else
debounce = false
end
end)
hopefully it works
It didn’t work either…I don’t know what’s going on, I have everything in its place and it still doesn’t work
the LocalScript at the top is in the wrong place, it should be inside of Frame
you should also turn on your Output whenever you script as it tells you exactly what the error is:
OOPS I’m an airhead I had made a mistake but now it works
THANK YOU VERY MUCH!!!
Result:
Thank you both for helping me :,D