Signup for scripting for coolieman2

View previous topic View next topic Go down

Signup for scripting for coolieman2

Post by coolieman2 on Sun Jun 23, 2013 8:52 am

1:A rail detector.

If you use function "function _G.Raildetect()" it will detect when a player will go through. I made a longer debounce because it takes time for the player to go away from the detector. There is a script in "Game.Workspace.StrandedEntries" and the detector brick would be "RailDetect".

Game.Workspace.StrandedEntries.RailDetect.Touched:connect(function()
debounce = true
if debounce then do
_G.RailDetect()
debounce = false
wait(10)
else
return end)

end)

So i know this is a small script but it will give you possibilities to make vehicle detectors. It doesn't have to be trains necessarily.

2:Vending machine

So i know this is old because i have made it before but i just wanted it to be an entry.

 function Event()
local A = Instance.new("Part", Game.Workspace)
A.Size = Vector3.new(1, 1, 1)
A.Position = Vector3.new(-38.4, 5, 40.7)
wait(10)
A.Name = "Piece of something"
A:Destroy()
end
Game.Workspace.VendingMachine.Button.ClickDetector.MouseClick:connect(Event)

It works in my scripting showcase.

3:AddPart global function.

So this is a function that takes a call and makes a part and sets the properties to what you want. Also the function just has so many parameters it doesn't fit on one row on the forums. You need to provide all the values of the properties listed inside the function. This is so you could just call a global function and provide the properties instead of doing "NEWPART = Instance.new("Part", Game.Workspace)" and then editing the properties seperately.

function _G.AddPart(BrickColor, Material, Reflectance, Transparency, Name, Parent, Position, Rotation, RotVelocity, Velocity, Anchored, Archivable, CanCollide, Locked, Elasticity, FormFactor, Friction, Shape, Size, BackParamA, BackParamB, BackSurfaceInput, BottomParamA, BottomParamB, BottomSurfaceInput, FrontParamA, FrontParamB, FrontSurfaceInput, LeftParamA, LeftParamB, LeftSurfaceInput, RightParamA, RightParamB, RightSurfaceInput, TopParamA, TopParamB, TopSurfaceInput, BackSurface, BottomSurface, FrontSurface, LeftSurface, RightSurface, TopSurface)
NEWPART = Instance.new("Part", Game.Workspace)
NEWPART.BrickColor = BrickColor
NEWPART.Material = Material
NEWPART.Reflectance = Reflectance
NEWPART.Transparency = Transparency
NEWPART.Name = Name
NEWPART.Parent = Parent
NEWPART.Position = Position
NEWPART.Rotation = Rotation
NEWPART.RotVelocity = Rotvelocity
NEWPART.Velocity = Velocity
NEWPART.Anchored = Anchored
NEWPART.Archivable = Archivable
NEWPART.CanCollide = CanCollide
NEWPART.Locked = Locked
NEWPART.Elasticity = Elasticity
NEWPART.FormFactor = FormFactor
NEWPART.Friction = Friction
NEWPART.Shape = Friction
NEWPART.Size = Size
NEWPART.BackParamA = BackparamA
NEWPART.BackParamB = BackParamB
NEWPART.BackSurfaceInput = BackSurfaceInput
NEWPART.BottomParamA = BottomParamA
NEWPART.BottomParamB = BottomParamB
NEWPART.BottomSurfaceInput = BottomSurfaceInput
NEWPART.FrontParamA = FrontParamA
NEWPART.FrontParamB = FrontParamB
NEWPART.FrontSurfaceInput = FrontSurfaceInput
NEWPART.LeftParamA = LeftParamA
NEWPART.LeftParamB = LeftParamB
NEWPART.LeftSurfaceInput = LeftSurfaceInput
NEWPART.RightParamA = RightParamA
NEWPART.RightParamB = RightParamB
NEWPART.RightSurfaceInput = RightSurfaceInput
NEWPART.TopParamA = TopParamA
NEWPART.TopParamB = TopParamB
NEWPART.TopSurfaceInput = TopSurfaceInput
NEWPART.BackSurface = BackSurface
NEWPART.BottomSurface = BottomSurface
NEWPART.FrontSurface = FrontSurface
NEWPART.LeftSurface = LeftSurface
NEWPART.RightSurface = RightSurface
NEWPART.TopSurface = TopSurface

end

 If this is not enough for you just ask.


Last edited by coolieman2 on Wed Jun 26, 2013 4:57 am; edited 1 time in total (Reason for editing : Added clearer title.)
avatar
coolieman2

Male Posts : 78
Join date : 2013-06-21
Location : Europe meaning i'm in a good timezone :)

View user profile

Back to top Go down

Re: Signup for scripting for coolieman2

Post by jobro13 on Wed Jun 26, 2013 7:07 am

Strange, I didn't see this. Accepted Smile
avatar
jobro13

Male Posts : 250
Join date : 2013-06-02

View user profile

Back to top Go down

Re: Signup for scripting for coolieman2

Post by coolieman2 on Thu Jun 27, 2013 6:47 am

The last one is a little bit overkill, don't you think? Because you have to put in EVERY single property on the function.
avatar
coolieman2

Male Posts : 78
Join date : 2013-06-21
Location : Europe meaning i'm in a good timezone :)

View user profile

Back to top Go down

Re: Signup for scripting for coolieman2

Post by jobro13 on Thu Jun 27, 2013 2:49 pm

Did you know that Roblox has a function called "create" (correct me if I'm mistaken). It supports a classname and a table of properties!

avatar
jobro13

Male Posts : 250
Join date : 2013-06-02

View user profile

Back to top Go down

Re: Signup for scripting for coolieman2

Post by coolieman2 on Fri Jun 28, 2013 4:16 pm

Really? Well that would be a waste of 10 minutes trying to type in the properties. That's nice to know. It's just annoying to create NEWPART = Instance.new("Part", <Index location>) and then editing the properties seperately.
avatar
coolieman2

Male Posts : 78
Join date : 2013-06-21
Location : Europe meaning i'm in a good timezone :)

View user profile

Back to top Go down

Re: Signup for scripting for coolieman2

Post by jobro13 on Sat Jun 29, 2013 5:30 am

You could make such thing yourself too Smile

Code:
function create(what, props)
local temporary = Instance.new(what)
for i,v in pairs(props) do
temporary[i] = v
end
end

Examples;

Code:
create("Part", {BrickColor = "Bright blue", Parent = game.Workspace})

or

local normal = {BrickColor = "Bright red", TopSurface = Enum.SurfaceType.Smooth}

create("Part", normal)

Dictionaries!
avatar
jobro13

Male Posts : 250
Join date : 2013-06-02

View user profile

Back to top Go down

Re: Signup for scripting for coolieman2

Post by Scarfacial on Sat Jun 29, 2013 9:59 am

jobro13 wrote:Did you know that Roblox has a function called "create" (correct me if I'm mistaken). It supports a classname and a table of properties

That's incorrect, but many users (myself included) have created such a function themselves and the use of said functions has become widespread due to ease of use. It's not a part of Roblox's default environment though.
avatar
Scarfacial

Posts : 15
Join date : 2013-06-03

View user profile http://survival303.pcriot.com/

Back to top Go down

Re: Signup for scripting for coolieman2

Post by jobro13 on Sun Jun 30, 2013 6:01 am

Is that so? I worked with ColorfulBody on a plugin manager sometime and he also used that function. If I am not mistaken, he used a library. I'll look it up.
avatar
jobro13

Male Posts : 250
Join date : 2013-06-02

View user profile

Back to top Go down

Re: Signup for scripting for coolieman2

Post by Sponsored content


Sponsored content


Back to top Go down

View previous topic View next topic Back to top


 
Permissions in this forum:
You cannot reply to topics in this forum