What do you want to achieve?
I want to make a frame Visible using proximity prompt
What is the issue?
frame is not visible
What solutions have you tried so far?
I tried my best to solve the issue, but it still doesn’t work ( I am an armateur scripter btw)
here is the script, it is in a part
local prompt = script.Parent.ProximityPrompt
local frame = game.StarterGui.ScreenGui:WaitForChild("Frame")
prompt.Triggered:Connect(function()
print("pressed") --This work
frame.Visible = true -- this doesn't
end)
Put a local script in the frame and do this instead:
local prompt = game.Workspace.Computer.ProximityPrompt --I think this is it?
local frame = script.Parent
prompt.Triggered:Connect(function(plr)
if plr == game.Players.LocalPlayer then
print("pressed") --This work
frame.Visible = true -- this doesn't
end
end)
the script doesn’t work, there’s something wrong with this line (sorry if this sound rude)
local prompt = game.Workspace.Computer.ProximityPrompt -- this line doesn't work
local frame = script.Parent
prompt.Triggered:Connect(function(plr)
if plr == game.Players.LocalPlayer then
print("pressed")
frame.Visible = true
end
end)
local script should be parented to the Gui frame in my example for it to work. The Gui frame and not in workspace because local scripts don’t run in workspace