Proximity prompt help

Hi, I am having an issue with a proximity prompt where it would work once but after using it, it wouldnt be affected.

code:

script.Parent.Triggered:Connect(function(plr)
	local plrGui = plr:WaitForChild("PlayerGui")
	local GUI = plrGui:WaitForChild("BulletsGui")
	
	local frame = GUI:WaitForChild("IndexMenu")
	frame.Visible = true
	frame:TweenSize(UDim2.fromScale(1,1),"InOut","Quint",0.5,true)
end)

Is this a LocalScript? It could be caused by replication issues if you do .Visible = false on the client and .Visible = true on the server.

no its a server script
limitthing

Yea, you have to make it a LocalScript. Put a LocalScript under your IndexFrame and paste this inside:

--//Services
local Players = game:GetService("Players")

--//Variables
local LocalPlayer = Players.LocalPlayer
local ProximityPrompt = workspace.ProximityPrompt --//Change this if needed
local Frame = script.Parent

--//Functions
ProximityPrompt.Triggered:Connect(function(player)
	if player ~= LocalPlayer then
		return
	end
	
	Frame.Visible = true
	Frame:TweenSize(UDim2.fromScale(1, 1), Enum.EasingDirection.InOut, Enum.EasingStyle.Quint, 0.5, true)
end)
1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.