Hi, i’m trying to make it so that whenever a player joins, there is a proximity prompt attached to it. This works, except the prompt is attached only to one player. Here’s a demo:
RS/Duel/StartDuel:
local prompt = script.Parent
local LastTargetPosition = script.Parent.Parent.HumanoidRootPart.CFrame
local Length = 20 -- Length between player and target player
prompt.Triggered:Connect(function(player)
print("Fired")
local PlayerHumanoid = player.Character.Humanoid
PlayerHumanoid.RootPart.CFrame = LastTargetPosition + LastTargetPosition.LookVector * Length
PlayerHumanoid.RootPart.CFrame = CFrame.new(PlayerHumanoid.RootPart.CFrame.Position, Vector3.new(LastTargetPosition.Position.X, PlayerHumanoid.RootPart.CFrame.Position.Y, LastTargetPosition.Position.Z))
end)
RS/Duel/LocalScript:
-- Used this as a source: https://devforum.roblox.com/t/adding-proximity-prompts-to-players/3315566/7
local player = game.Players.LocalPlayer
local char = player.Character or player.CharacterAdded:Wait()
local proximityPrompt = char:WaitForChild("Duel") :: ProximityPrompt -- The :: ProximityPrompt basically says "This IS a proxy prompt"
proximityPrompt.Enabled = false
SSS/Script:
local rs = game:GetService("ReplicatedStorage")
local prompt = rs:WaitForChild("Duel")
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(player)
prompt.Parent = player.Character or player.CharacterAdded:Wait()
end)
Anyone got any clues on how to fix it?