Talk:Basic Scripting

From Legacy Roblox Wiki
Jump to navigationJump to search

Go ahead Mr. Doom, I did the best I could! I hope you dont have to much to edit. :) ---PCwiener 16:42, 14 July 2007 (CDT)

The following scripts have been tested:

function onTouched(hit)
	script.Parent.Parent.Door.Transparency= 1 -- an invisible door
	script.Parent.Parent.Door.CanCollide= false -- a walkthroughable door
	wait(3)
	script.Parent.Parent.Door.Transparency= 0.3  -- a partially visible door 
	script.Parent.Parent.Door.CanCollide= true -- a door you can't walk through anymore
end
script.Parent.Touched:connect(onTouched)
function onTouched(hit)
	script.Parent.Parent.Door.BodyA.Transparency= 1
	script.Parent.Parent.Door.BodyB.Transparency= 1
        script.Parent.Parent.Door.BodyA.CanCollide= false
        script.Parent.Parent.Door.BodyB.CanCollide= false
        wait(3)
	script.Parent.Parent.Door.BodyA.Transparency= 0.3
	script.Parent.Parent.Door.BodyB.Transparency= 0.3
        script.Parent.Parent.Door.BodyA.CanCollide= true
        script.Parent.Parent.Door.BodyB.CanCollide= true
end
script.Parent.Touched:connect(onTouched)
door = script.Parent.Parent.Door
function onTouched(hit)
	door.Transparency = 1
	door.CanCollide = false
	wait(3)
	door.Transparency = 0.3
	door.CanCollide = true
end

script.Parent.Touched:connect(onTouched)
door = script.Parent.Parent.Door
function onTouched(hit)
	door.BodyA.Transparency= 1
	door.BodyB.Transparency= 1
        door.BodyA.CanCollide= false
        door.BodyB.CanCollide= false
        wait(3)
	door.BodyA.Transparency= 0.3
	door.BodyB.Transparency= 0.3
        door.BodyA.CanCollide= true
        door.BodyB.CanCollide= true
end
script.Parent.Touched:connect(onTouched)
debounce = false
function onTouched(hit)
	if debounce == false then
		debounce = true
		msg = Instance.new("Message")
		msg.Parent = game.Workspace
		msg.Text = "This is the sample message text."
		wait(3)
		msg:remove()
		debounce = false
	end
end

script.Parent.Touched:connect(onTouched)
while true do
wait(001)
msg = Instance.new("Message")
msg.Parent = game.Workspace
msg.Text = "Please send me a friend request!"
wait(300)
msg:remove()
end

so these actually work.

MINDRAKER 08:18, 19 August 2008 (CDT)