#Help with a Bush Rustle script

32 messages · Page 1 of 1 (latest)

analog field
#

I was wondering how I could make an optimized bush rustle script (For example, when a player touches a part named "Bush", the bush moves slightly and plays a sound) without having 300 bushes all with 1 script inside of each of them, for optimization purposes. Is there a way to make it so I can do this in 1 script and have it always do what I need it to without having a lot of scripts?

icy pollen
#

use variables

analog field
icy pollen
#

ok

#

so thats really easy

analog field
icy pollen
#
link = script.parent
linkother = game.workspace.Folderwithbush


#

now

#

let me teach you what you can do with that

#

are u here?

visual leaf
icy pollen
#

with

#
while true do

#

if a part is activated

#

it can run to see if all the others are being touched

analog field
analog field
icy pollen
#

let me help

#

so

#

what wou want to do

#

is use something like this

#

--[[ 
-SCRIPT PURPOSE-

So the parts mentioned below are parts that go on and off for the heist feeling.

Second light
third light
fourth light
circlular light

What this does is it makes the lights go on and off to red neon after you enter the submarine.



--]]



link = script.Parent
otherlinks = game.Workspace["Submarine Models"].Lights
switchoff = game.Workspace.Sounds.switch_off
switchon = game.Workspace.Sounds.switch_on
eventrun = 1

--Switches lights off with the sound | This part only
wait(1)
link.Material = ("SmoothPlastic") 

--Other Lights | Other parts only
otherlinks["Second Light"].Material = ("SmoothPlastic")
otherlinks["Third Light"].Material = ("SmoothPlastic")
otherlinks["Fourth light"].Material = ("SmoothPlastic")
otherlinks["Fifth Light"].Material = ("SmoothPlastic")
otherlinks["Circlular light"].Material = ("SmoothPlastic")


--Sound is played here
switchoff:Play()
wait(2)

--Switches lights back on | This part only
link.Material = ("Neon")

--Other Lights change to neon
otherlinks["Second Light"].Material = ("Neon")
otherlinks["Third Light"].Material = ("Neon")
otherlinks["Fourth light"].Material = ("Neon")
otherlinks["Fifth Light"].Material = ("Neon")
otherlinks["Circlular light"].Material = ("Neon")

--Colour Changing To red after lights go off/on | This part only
link.Color = Color3.new(1, 0, 0)

if link.Color == Color3.new(1, 0, 0) then
    print("Lights Code Red", 1)
end

--Other lights changing to red | Other parts only
otherlinks["Second Light"].Color = Color3.new(1, 0 , 0)
otherlinks["Third Light"].Color = Color3.new(1, 0 , 0)
otherlinks["Fourth light"].Color = Color3.new(1, 0 , 0)
otherlinks["Fifth Light"].Color = Color3.new(1, 0 , 0)
otherlinks["Circlular light"].Color = Color3.new(1, 0 , 0)


switchon:Play()

-- Script made for ahmad by cat :)```
#

this is part of a script in my game

analog field
#

so I should use if statements?

visual leaf
icy pollen
#

;/

analog field
#

what about the position change, it should be random rotation in any direction

visual leaf