**[READ] ** What I'm attempting to do is when I walk a part the GUI comes up on my screen and when I walk away (not touching the part) the GUI lowers out of view. Im sure Im going at this the wrong way, or my mind is just being slow today. I have no errors, so no worries about that.
When I walk on the brick it comes up, but when I walk away it will not go away. Help? Ideas? ANything to set me on the correct path will be helpful.
Server code..
local Players = game:GetService("Players")
local RS = game:GetService("ReplicatedStorage")
local CS = RS:WaitForChild("CrossServer")
local Open_UI = CS:WaitForChild("Open UI")
script.Parent.Touched:connect(function(obj)
if obj ~= nil and (obj.Parent) ~= nil then
local plr = Players:GetPlayerFromCharacter(obj.Parent)
if plr ~= nil then
Open_UI:FireClient(plr, true)
end
end
end)
script.Parent.TouchEnded:connect(function(obj)
if obj ~= nil and (obj.Parent) ~= nil then
local plr = Players:GetPlayerFromCharacter(obj.Parent)
if plr ~= nil then
Open_UI:FireClient(plr, true)
end
end
end)
Local code
local ShopOpen = false
local RS = game:GetService("ReplicatedStorage")
local CS = RS:WaitForChild("CrossServer")
local UI_Open = CS:WaitForChild("Open UI")
local UI = script.Parent
local MainFrame = UI:WaitForChild("MainFrame")
local MenuBar = MainFrame:WaitForChild("MenuBar")
local UpdatePos = function()
if ShopOpen == true then
MainFrame:TweenPosition(UDim2.new(.5,-300,.5,-200))
else
MainFrame:TweenPosition(UDim2.new(.5,-300,1,400))
end
end
UpdatePos()
UI_Open.OnClientEvent:connect(function(Bool)
ShopOpen = Bool
UpdatePos()
end)

6 comments
I was having a problem with touchended also. Solution would be really nice.
Debounce Touched until TouchEnded fires
Yeah, You need a debounce
http://wiki.roblox.com/index.php?title=Debounce wiki page on debounce
Im trying to work around debounce. This will be a fully functional game so the Debounce would need to be a table for each user. Thats what I DONT want to do.
Line 19. I'm assuming it should be false, not true.