Oh no, I can't heal him! *He dies. "OMG"

I am about to release my newest game but I can’t quite get this healing system to work.

What have you tried?
I have tried putting a proximityprompt inside the StarterCharacter’s Torso and disabling it for the torso’s owner only. The problem with that is that the prompt will not trigger.

Here is the script: (Server script inside the prompt)

script.Parent.Triggered:Connect(function(player)
	print("triggered!")
	script.Parent.Parent.Parent:FindFirstChild("Humanoid").Health = 100
	game.ReplicatedStorage.EventsAndFunctions:FindFirstChild("Heal"):FireAllClients(player.Name, script.Parent.Parent.Parent.Name)
end)

The event (above) that is being fired simply shows everyone who was healed. (It also does not work. This is inside a text label in StarterGui)

Script for everyone to see who was healed: (I added a typewriter effect to it. Its a local script)

local replicatedStorage = game:GetService("ReplicatedStorage")

local function displayHealed(text)	
	local split = string.split(text, "")
	script.Parent.Text = ""

	for i, v in pairs(split) do
		script.Parent.Text = 	script.Parent.Text .. v
		wait(0.1)
	end
	wait(3)
	script.Parent.Text = ""
end

script.Parent.Text = ""

replicatedStorage:FindFirstChild("EventsAndFunctions"):FindFirstChild("Heal").OnClientEvent:Connect(function(healerName, healedName)
	local text = tostring(healerName) .. " has healed " .. tostring(healedName)
	displayHealed(text)
end)

Also, here is the script that disables the proximity prompt for the torso owner. (Inside StarterCharacterScripts. Its a local script)

local character = script.Parent
wait()
local torso = character:FindFirstChild("Torso")
torso:FindFirstChild("Heal").Enabled = false

By the way, no errors appeared inside the output.

I believe the problem is that you are firing it as player.Name and not the player itself. Change player.Name to just player.

game.ReplicatedStorage.EventsAndFunctions:FindFirstChild("Heal"):FireAllClients(player, script.Parent.Parent.Parent.Name)

Its FireAllClients there is no player argument as it is sent to all clients. The only arguments needed/not needed are tuple arguments.

1 Like

There is no problem with the script as far as I see, sorry.

1 Like

That would be the proximity prompt script I gave above. Once it is triggered, it is supposed to fully heal the player.

I’ll check this out and see if I can figure out the problem.

1 Like

I’m not sure, for me it doesn’t even show other people’s proximity prompts. And, it does trigger my own if i enable it, but nobody else can even see it. Sorry. I hope you figure this problem out though

1 Like