Need script form another Model

I have a script and it is on a block gate, but I want it on another model.

https://gyazo.com/2bdb97edf259cac52744b1fb19ef3603(Gate that I need script from), https://gyazo.com/2bdb97edf259cac52744b1fb19ef3603(Where I want the script to work)
https://gyazo.com/3774eeb8c3b7a6f32a3cc13bcac691b2(The script)

I tried put the script in the model but since I am terrible at scripting, I don’t know how.

If anyone can help me I would really appreciate it.

First I recommend a Bool to define whether the roadblocks are up or not then I recommend using Tweens for animating your road

the style your code is written in is kinda old no offence… Its why i recommended tween service will allow you to achieve a more smooth animation

1 Like

I don’t understand anything sorry I am really and idiot in scripting

1 Like

That’s not a style. That’s just bad coding standards. No indentations. It’s hard to read and harder to maintain. Also the script is sent as a photo and not as a codeblock. That makes it more difficult to help.

I’d also recommend using Tweens since that would be smooth as Extrenious has mentioned. @Ge_inki How many bollards are there? Are they considered a group or each bollard is an individual part?

1 Like

Sorry I am really bad at scripting as I said, here it is:

Speed = 2.5 – Speed at which the door rises. Higher = faster.

Time = 10 – Time between the door totally open and starting to close.

Running = false

for x,z in pairs(script.Parent.Parent:getChildren()) do

if z.Name == “Button” then

z.CD.MouseClick:connect(function ()

if Running == true then return end

Running = true

for i=1,script.Parent.Size.z/Speed*9+1 do

script.Parent.CFrame = script.Parent.CFrameCFrame.new(0,0,-0.1Speed)

script.Parent.Parent.Button.BrickColor = BrickColor.new(“Bright red”)

wait()

end

wait(Time)

for i=1,script.Parent.Size.z/Speed*9+1 do

script.Parent.CFrame = script.Parent.CFrameCFrame.new(0,0,0.1Speed)

script.Parent.Parent.Button.BrickColor = BrickColor.new(“Bright green”)

wait()

end

Running = false

end)

end

end

1 Like

I’ve gone ahead and formatted the code into a codeblock for ease of reading. Are you using some sort of template or script that was made for something else?

Speed = 2.5 – Speed at which the door rises. Higher = faster.

Time = 10 – Time between the door totally open and starting to close.

Running = false

for x,z in pairs(script.Parent.Parent:getChildren()) do

if z.Name == “Button” then

z.CD.MouseClick:connect(function ()

if Running == true then return end

Running = true

for i=1,script.Parent.Size.z/Speed*9+1 do

script.Parent.CFrame = script.Parent.CFrameCFrame.new(0,0,-0.1Speed)

script.Parent.Parent.Button.BrickColor = BrickColor.new(“Bright red”)

wait()

end

wait(Time)

for i=1,script.Parent.Size.z/Speed*9+1 do

script.Parent.CFrame = script.Parent.CFrameCFrame.new(0,0,0.1Speed)

script.Parent.Parent.Button.BrickColor = BrickColor.new(“Bright green”)

wait()

end

Running = false

end)

end

end

Yes it is a freemodel, and do I put this script in the model I need?

1 Like

Can you help me of what I do in easier terms because I don’t know anything in scripting.

I’d recommend checking out the developer hub. You’ll want to look into the TweenService. For what you’re trying to do I’d also recommend learning how to use FindFirstChild, WaitForChild, and looking through the workspace for your bollards.

From there you’ll need to make a tween for your bollards that move them up or down. This should be based on Coordinate Frames or CFrames, This could have the caveat of messing with the collisions though, so perhaps modifying the Position instead would be better. Currently it’s like 2AM here, and I have no intentions on writing a script. If someone else is interested they can do so. However, I believe my recommendations should push you in the right direction.

Some basic knowledge of Lua or previous experience in programming may be neccessary. You can always reply to this post and the community will be there to help. :slight_smile:

1 Like

Just so this is buried in the public record, @Ge_inki was asking for scripting support using an experience that is entirely place stolen (places can be stolen using any popular executor). Of course, these executors don’t catch (server) scripts, only parts, so here he is desperately trying to get scripting support for his non-functional, stolen game. Myself and other developers worked hard to create the original game. This is me in studio in the legitimate copy, and you can cross-reference this with his image he initially posted of him in the same location.

2 Likes