So, i made a script using Lua, basically the script is it :
local a = false
game.Players.PlayerAdded:Connect(function(player)
game.Workspace.Part.Touched:Connect(function(hit)
while true do
wait(0.5)
if hit.Parent:FindFirstChild("Humanoid") and a == false and player.GameStats.Body.Value <= 200 then
a = true
hit.Parent.Humanoid:TakeDamage(50)
player.GameStats.Body.Value = player.GameStats.Body.Value + 2
wait(1)
a = false
end
while true do
wait(0.5)
if hit.Parent:FindFirstChild("Humanoid") and a == false and player.GameStats.Body.Value >= 201 then
a = true
hit.Parent.Humanoid:TakeDamage(1)
player.GameStats.Body.Value = player.GameStats.Body.Value + 2
wait(1)
a = false
end
end
end
end)
end)
So, i made this script with a program called Roblox Studio, and then i made a damage brick, that only will take 50 dmg if who touched has 200 (or less) Body force, otherwise the brick will deal 1 dmg. Ok, the script's working, but when my friend joins(I'm 1 quadrillion body and he's 160) the brick deal 50 damage for me and for he, not 1 only for me and for he, 50. SO, basically i want to solve that error, the script only works if just 1 guy in the server, basically a individual script.