What do you want to achieve? I want to make A system where players can buy land and A Gui to do so appears wheN touched. This works but I cannot make it vanish afterwards.
What is the issue? My script fires A remote event in the replicated storage from A script inside of the part to A local script inside of Screen Gui.
Script:
local RS = game:GetService("ReplicatedStorage")
local Event = RS:WaitForChild("GuiAppear")
function onTouched(hit)
local player = game:GetService("Players"):GetPlayerFromCharacter(hit.parent)
if player then
Event:FireClient(player)
end
end
script.Parent.Touched:Connect(onTouched)
Local Script:
local RS = game:GetService("ReplicatedStorage")
local Event = RS:WaitForChild("GuiAppear")
Event.onClientEvent:Connect(function()
script.Parent.PlotGui.Visible = true
end)
What solutions have you tried so far? I tried using if and else-if statements and then setting the visibility to false but I could not make this work.
This works but I am using R15 Models Dunno if their is A difference in R6 but whenever the character moves the Gui vanishes and returns, do I use scripting to fix this?
I’m having a bit of trouble understanding what you want. Do you want the GUI to be toggled when the player hits the part? This means that the GUI will close if it is already open, and open if it is not already.
I will try and explain again: My Gui opens when A part is stood on and closes when someone leaves it. I have managed to do that but now when the player walks on the part the Gui flickers in and out.