I am currently trying to make a script where if a player has a certain tool, a cutscene plays. The cutscene is triggered if the player triggers a proximity prompt, which is only enabled if a player has a certain tool. This is my script so far, and I am not sure what to do. The proximity prompt is not enabled by default.
local Tool = "Tazer"
local ProximityPrompt = game.Workspace.Test.ProximityPrompt
local function updateProximityPrompt(player)
local hasTool = player.Backpack:FindFirstChild(Tool) or player.Character:FindFirstChild(Tool)
if hasTool == true then
ProximityPrompt.Enabled = true
else
ProximityPrompt.Enabled = false
end
end
ProximityPrompt.Triggered:Connect(function(player)
local proximitytrigger = game.ReplicatedStorage.ProximityTrigger
if player then
game.ReplicatedStorage.ProximityTrigger:FireClient(player)
else
print("No player")
end
end)