ROBLOX - initiation LUA
Exemple de script simple
------------------------------------------------------
local part = Instance.new("Part")
part.Parent = workspace
part.Size = Vector3.new(100, 1, 100)
part.Position = Vector3.new(0, 0, 0)
part.Anchored = true
------------------------------------------------------
-- création du sol
local sol = Instance.new("Part")
sol.Parent = workspace
sol.Size = Vector3.new(1000, 1, 1000)
sol.Position = Vector3.new(0, 0, 0)
sol.Anchored = true
sol.Color = Color3.new(1,1,1)
sol.Parent = game.Workspace
---------
local count = 0;
function makePart()
local rand = math.random(1000)
local part = Instance.new('Part')
part.Parent = game.Workspace
part.Size = Vector3.new(5, 5, 5)
part.Position = Vector3.new(0, 20, 20)
if count%2 ==0 then
part.Color = Color3.new(0,0,0)
else
part.Color = Color3.new(1,1,1)
end
part.Anchored = false
wait(1)
part.Touched:Connect(function(Hit)
local h = Hit.Parent:FindFirstChild("Humanoid") if h ~= nil then
--h.Health = 0
part:Destroy()
print("YOU DIE !!")
end
end)
count = count + 1
end
---------------------
while true do
makePart()
end
-------------------
Commentaires
Enregistrer un commentaire