You can write your topic however you want, but you need to answer these questions:
- What do you want to achieve? Keep it simple and clear!
I am trying to create a ProximityPrompt to parent each player’s character HumanoidRootPart on the server except the local player.
- What is the issue? Include screenshots / videos if possible!
The ProximityPrompt does not appear or it some hows parents itself to the local player.
- What solutions have you tried so far? Did you look for solutions on the Developer Hub?
Devfourm and testing with friends.
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
Client:
local Plr=game.Players.LocalPlayer
local Remote_Events=game.ReplicatedStorage.Remote_Events
game.Players.PlayerAdded:Connect(function(Other_Plr)
Other_Plr.CharacterAdded:Connect(function()
wait()
if Other_Plr.Name~=Plr.Name then
Remote_Events.ProximityPrompt:FireServer(Other_Plr)
end
end)
end)
for _,Other_Plr in pairs(game.Players:GetChildren()) do
if Other_Plr.Name~=Plr.Name then
Remote_Events.ProximityPrompt:FireServer(Other_Plr)
end
end
while wait() do
local HumanoidRootPart=Plr.Character:WaitForChild("HumanoidRootPart")
if HumanoidRootPart then
local ProximityPrompt=Plr.Character.HumanoidRootPart:FindFirstChild("ProximityPrompt")
if ProximityPrompt then
ProximityPrompt:Destroy()
end
end
end
Server:
Remote_Events.ProximityPrompt.OnServerEvent:Connect(function(Plr,Other_plr)
print(Other_plr)
Main_Modules.ProximityPrompt(Other_plr)
end)
Module:
function Main_Modules.ProximityPrompt(Other_plr)
local ProximityPrompt=Instance.new("ProximityPrompt")
ProximityPrompt.Parent=Other_plr.Character.HumanoidRootPart
ProximityPrompt.HoldDuration=1
ProximityPrompt.ActionText="Steal"
ProximityPrompt.ObjectText="@"..Other_plr.Name
end