#Problem basic script
1 messages · Page 1 of 1 (latest)
Your "character" value isn't referencing the character I believe
im confused as to why you're doing hit == part
Agh same lol, btw it work
How i can local character please
if teuer is a basepart and the hit HAS to be teuer why would it be a character
uh
** You are now Level 1! **
hitbox's parent is workspace not a character
character = hit.Parent
and make sure its a character by doing if character:FindFirstChildOfClass("Humanoid") then
Okey ty
Still dont work
i think character is not hit.parent
or idk
are you trying to make it only function if the hit part is the part variable
you can only get the character if its the character thats touching the part
it doesnt work because youre making sure hit == part
I want that when the hitbox just touches the part, I die
do you want everyone to die or a specific guy to die
** You are now Level 1! **
everyone
lmao u join the game, ur hitbox touch the part, u die
just that
because youll have to loop through game.Players and kill them by player.Character
so if hit == part then
for v, playas in ipairs(game.Players:GetPlayers()) do playas.Character.Humanoid.Health = 0 end
no problem yo
i think because you put lafoction
do you know you don't need pairs or ipairs anymore
roblox handles it already
so you can just for _, item in table do
Wait but doesn't ipairs make it so that it goes through everything in order?
Or does it automatically do that now?
the problem was to local character
** You are now Level 2! **
thats not hit.parent
but mine was hitbox.parent
local hitbox = script.Parent
local part = workspace.tueur
hitbox.Touched:Connect(function(hit)
if hit == part then
local character = hitbox.Parent
local humanoid = character:FindFirstChild("Humanoid")
if humanoid then
humanoid.Health = 0
end
end
end)