I am making a game with a tool that, when equipped, will place a ProximityPrompt in a part in the Workspace. When unequipped, this proximityprompt will disappear. I also want this proximity prompt to be clientsided, and then when it is activated, run serverside code. I am guessing I will have to do that with a remote event but idrk what to do. I have written some code for it, but the proximity prompt is not appearing. If you would like to see the code then I will gladly post it
No matter what you create on the client, the server will not see it. That’s the goal of the client-server boundary and FilteringEnabled. If you’d like to make a proximity prompt appear only for you and run some serverside code, you should make a RemoteEvent and a server script for that code, and a client script that detects when the proximity prompt in question is activated.
Your code will likely differ but the basic implementation is as follows:
Client:
tool = path.to.tool
event = path.to.remoteevent
part = path.to.part
proximityprompt = nil
tool.Equipped:Connect(function()
proximityprompt = Instance.new("ProximityPrompt", part)
proximityprompt.Triggered:Connect(function()
event:FireServer()
end)
end)
tool.Unequipped:Connect(function()
if proximityprompt then
proximityprompt:Destroy()
end
end
Server:
remoteevent = path.to.remoteevent
remoteevent.OnServerEvent:Connect(function()
--code here
end)
alr thanks i will try it and let you know if it doesnt work
not working, i modified the code and i also fixed the error you had with unequipped function, the proximity prompt is not appearing
@vopwn55 the thing is appearing in the editor, which means it is being created. the only thing is that i cant see it in game