|
| 11 Aug 2012 03:17 PM |
So the wiki doesn't help me at all at scripting, but I joined a couple of some Scripting Hepers group and they said that go to their LuaLearners webpage. I'm doing great so far. But this script looks worng. So I tested it. And I was right, something is wrong. This is the script:
function onTouched(MyPartEats) local h = Part.Parent:findFirstChild("Humanoid") if h ~= nil then h.Health = 0
local p = Instance.new("Message",game.Workspace) p.Text = "Die!"
game.Workspace.Part.Color = Color3.new(math.random(0,255), math.random(0,255), math.random(0,255))
game.Workspace.Part.Position = Vector3.new(0, 20, 0)
end end
script.Parent.Touched:connect(onTouched)
And yes, the Part is named MyPartEats. This was the assignment that told me what to do. Here is what the assignment is.
"Here is your assignment.
Make a brick that does the following:
Change the color when touched.
Kills the player that touched it.
Moves the brick to a random location between 0 and 20 on all axis.
Inserts a message into workspace that says somebody touched the part." |
|
|
| Report Abuse |
|
| |
|
| 11 Aug 2012 03:21 PM |
Nevermind, it's works. FINALLY!! A SCRIPT THAT I WROTE WORKS!!! VICTORY IS MINE! YES! YES! YES! YES! YES! YES! |
|
|
| Report Abuse |
|