--example if something is touched like a part. it is gonna do something to the humanoid
local part = script.Parent --this is the part... put the script in the part
part.Touched:Connect(function(player) --this is when the player touched the brick. we are also gonna name it player
local hum = player.Parent:FindFirstChildWhichIsA("Humanoid") --here we gonna check the humanoid
if hum then -- here we gonna check if it is a humanoid
--code: example... you can change the health, walkspeed , jumpspeed and more
end
end)
local Players = game:GetService("Players")
local TouchPart = workspace["Part"] -- assign a part to it
TouchPart.Touched:Connect(function(touched)
if touched.Parent:IsA("Model") and touched.Parent:FindFirstChild("Humanoid") then
local Player = Players:GetPlayerFromCharacter(touched.Parent)
if Player then
-- do something here
end
end
end)