Are you referring to the first prototype of his program?
I noticed that, too, but it does not become an issue in his code.
Every time he wants to retrieve it, he does so correctly.
if not isPartOfPlayerInHitbox then
print(player.Name)
event:FireClient(game.Players:FindFirstChild(player.Name), false)
table.remove(touchingPlayers, index)
end
i feel like this isnāt properly triggering, thus causiing the event not to fire. there arenāt any errors with the code as far as i know of.
every lucky while. this is another reason i think its the code i mentioned above not working, if it does work, it works like a charm, if it doesnāt⦠you know the drill. i have been at this one thing since 11 am this morning. its currently 9:30 pm
Well, that leads me to think it could be an issue with collision detection, which is something I have suspected for a while, particularly because .Touched is not the most reliable.
Although .Touched is mostly reliable for stationary targets, so it would confuse me why it would be an issue (unless your fires are moving around).
Okay, could you send both the client and server scripts once more.
Iām just gonna keep looking over them until I find what in the world is going on; itās starting to bother me, too.
If you are willing to give my script a shot with your initial code.
Client:
local Player = game:GetService("Players").LocalPlayer
local heat = 100
local maxHeat = 100
local isTouchingFireValue = Player.PlayerGui:WaitForChild("IsTouchingFire")
local runService = game:GetService("RunService")
local function updateHeatUI()
script.Parent.Size = UDim2.new(math.clamp(heat / maxHeat, 0, 1), 0, 1, 0)
print(heat .. "/" .. maxHeat)
print(isTouchingFireValue.Value)
end
runService.Heartbeat:Connect(function(deltaTime)
if isTouchingFireValue.Value then
heat = math.clamp(heat + 2 * deltaTime, 0, maxHeat)
else
heat = math.clamp(heat - 1 * deltaTime, 0, maxHeat)
end
updateHeatUI()
end)
Server:
local firebox = script.Parent
local Players = game:GetService("Players")
local touchingPlayers = {}
function onTouched()
local currentlyTouching = {}
for _, Part in pairs(firebox:GetTouchingParts()) do
local Player = Players:GetPlayerFromCharacter(Part.Parent)
if Player and not table.find(currentlyTouching, Player) then
table.insert(currentlyTouching, Player)
end
end
for _, Player in ipairs(touchingPlayers) do
local IsTouchingFire = Player.PlayerGui:FindFirstChild("IsTouchingFire")
if not IsTouchingFire then continue end
if table.find(currentlyTouching, Player) then
IsTouchingFire.Value = true
else
IsTouchingFire.Value = false
end
end
touchingPlayers = currentlyTouching
end
firebox.Touched:Connect(onTouched)
firebox.TouchEnded:Connect(onTouched)
I keep looking over it and I just canāt seem to find an issue with the server script.
However, I keep coming back to that error regarding bool.
I can almost swear that you have to check if itās not nil and then change touchingFire to bool.
But if it doesnāt work, then I really am starting to have no idea.