You can write your topic however you want, but you need to answer these questions:
-
What do you want to achieve? Keep it simple and clear!
-
What is the issue? Include screenshots / videos if possible!
My script after searching for the modules it stops working
- What solutions have you tried so far? Did you look for solutions on the Creator Hub?
After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
-- Scavenging module
local scavenge = {}
local Anomalies_List = require(script.Anomalies_List)
local Zone = require(script.Parent.Zone)
local OfficeModule = require(game.ReplicatedStorage.Modules.Office)
function scavenge.Start(location)
print("a")
if game.ReplicatedStorage.Values.Office.Value == true then
Office_Teleportation()
game.ReplicatedStorage.Events:WaitForChild("Scavenge_Event"):FireAllClients("Ended")
return
end
for i, locat in pairs(workspace.Location_Map:GetChildren()) do
if locat:IsA("Folder") then
locat:Destroy()
end
end
game.ReplicatedStorage.Values.Scavenging.Value = true
if location == "Area-51" then
-- needs to be night later on, plrs number, ect
game.ReplicatedStorage.Values.Scavenging.Scavenged_Need.Value = 3
game.ReplicatedStorage.Values.Scavenging.AreaIn.Value = "Area-51"
local NewLocat = game.ReplicatedStorage.Assets.Locations["Area-51"]:Clone()
NewLocat.Parent = workspace.Location_Map
NewLocat:WaitForChild("Lighting").Sky.Parent = game.Lighting
game.Lighting.Ambient = NewLocat:WaitForChild("Lighting").Ambient.Value
game.Lighting.ClockTime = NewLocat:WaitForChild("Lighting").ClockTime.Value
local colorGrad = NewLocat.Lighting.ColorGrading:Clone()
colorGrad.Parent = game.Lighting
game.ReplicatedStorage.Events:WaitForChild("Scavenge_Event"):FireAllClients("StartScavenge")
for i, parts in pairs(NewLocat:FindFirstChild("Doors"):GetDescendants()) do
if parts:IsA("Part") then
if parts.Name == "VentDoor" then
local proximityPrompt = Instance.new("ProximityPrompt")
proximityPrompt.Parent = parts
proximityPrompt.Enabled = true
proximityPrompt.HoldDuration = .1
proximityPrompt.Name = "VentDoorPrompt"
proximityPrompt.Triggered:Connect(function(plr)
--game.TweenService:Create(proximityPrompt.Parent.Parent.Parent:FindFirstChild("Extra"):FindFirstChild("SpecialVentDoor"),TweenInfo.new(1),{["CFrame"] = }):Play()
end)
end
if parts.Name == "Close1" or parts.Name == "Close2" then
local proximityPrompt = Instance.new("ProximityPrompt")
proximityPrompt.Parent = parts
proximityPrompt.Enabled = false
proximityPrompt.HoldDuration = .1
proximityPrompt.Name = "DoorPrompt"
proximityPrompt.Triggered:Connect(function(plr)
game.TweenService:Create(parts.Parent.Parent:WaitForChild("Door"):WaitForChild("Door"),TweenInfo.new(5,Enum.EasingStyle.Sine),{["Position"] = parts.Parent.Parent:WaitForChild("Door"):WaitForChild("Door").Position - Vector3.new(0,7.9,0)}):Play()
plr.PlayerGui:WaitForChild("Sounds"):WaitForChild("Area-51"):WaitForChild("Door_button_press_sound"):Play()
plr.PlayerGui:WaitForChild("Sounds"):WaitForChild("Area-51"):WaitForChild("Door_opening_and_closing_sound"):Play()
parts.Parent:WaitForChild("Close1").DoorPrompt.Enabled = false
if parts.Parent:FindFirstChild("Close2") then
parts.Parent:WaitForChild("Close2").DoorPrompt.Enabled = false
end
task.wait(5.5)
parts.Parent:WaitForChild("Open1").DoorPrompt.Enabled = true
if parts.Parent:FindFirstChild("Open2") then
parts.Parent:WaitForChild("Open2").DoorPrompt.Enabled = true
end
end)
elseif parts.Name == "Open1" or parts.Name == "Open2" then
local proximityPrompt = Instance.new("ProximityPrompt")
proximityPrompt.Parent = parts
proximityPrompt.HoldDuration = .1
proximityPrompt.Name = "DoorPrompt"
proximityPrompt.Triggered:Connect(function(plr)
game.TweenService:Create(parts.Parent.Parent:WaitForChild("Door"):WaitForChild("Door"),TweenInfo.new(5,Enum.EasingStyle.Sine),{["Position"] = parts.Parent.Parent:WaitForChild("Door"):WaitForChild("Door").Position + Vector3.new(0,7.9,0)}):Play()
-- parts.Parent.Parent:WaitForChild("Door"):WaitForChild("Door").CanCollide = false
plr.PlayerGui:WaitForChild("Sounds"):WaitForChild("Area-51"):WaitForChild("Door_button_press_sound"):Play()
plr.PlayerGui:WaitForChild("Sounds"):WaitForChild("Area-51"):WaitForChild("Door_opening_and_closing_sound"):Play()
parts.Parent:WaitForChild("Open1").DoorPrompt.Enabled = false
if parts.Parent:FindFirstChild("Open2") then
parts.Parent:WaitForChild("Open2").DoorPrompt.Enabled = false
end
task.wait(5)
-- parts.Parent.Parent:WaitForChild("Door"):WaitForChild("Door").CanCollide = true
task.wait(.5)
parts.Parent:WaitForChild("Close1").DoorPrompt.Enabled = true
if parts.Parent:FindFirstChild("Close2") then
parts.Parent:WaitForChild("Close2").DoorPrompt.Enabled = true
end
end)
end
end
end
for i, anomalies in pairs(NewLocat:FindFirstChild("Anomalies"):GetChildren()) do
if anomalies:IsA("Model") then
local prox = Instance.new("ProximityPrompt")
prox.Parent = anomalies:FindFirstChild("Torso")
prox.MaxActivationDistance = 10
prox.RequiresLineOfSight = false
if anomalies:FindFirstChild("Settings") then --Highlight
if anomalies:FindFirstChild("Settings"):FindFirstChild("HighlightColor") then
local highlight = Instance.new("Highlight")
highlight.Parent = anomalies
highlight.FillTransparency = 1
highlight.OutlineColor = anomalies:FindFirstChild("Settings"):FindFirstChild("HighlightColor").Value
highlight.OutlineTransparency = 0
highlight.DepthMode = Enum.HighlightDepthMode.Occluded
end
end
if anomalies:FindFirstChild("Settings") then --Idle Animation
if anomalies:FindFirstChild("Settings"):FindFirstChild("Idle") then
if anomalies:FindFirstChild("Settings"):FindFirstChild("Idle").AnimationId ~= "" then
local idleAnim = anomalies:WaitForChild("Humanoid"):LoadAnimation(anomalies:FindFirstChild("Settings"):FindFirstChild("Idle"))
idleAnim:Play(0)
end
end
end
prox.Triggered:Connect(function(plr)
PickUp_Anomaly(prox.Parent.Parent,plr)
end)
end
end
task.wait(1)
for i, plr in pairs(game.Players:GetPlayers()) do
plr.Character.PrimaryPart.CFrame = NewLocat:FindFirstChild("Spawn").CFrame
end
task.wait(1.5)
local Elevator = NewLocat.Morket
Elevator.Cart.Special.Car.CFrame = Elevator.Cart.Special.Car.SpecialCF.Value
local doorElevaotr = Elevator.Humanoid:LoadAnimation(Elevator.Configuration.Open)
game.TweenService:Create(Elevator.Cart.Special.Car,TweenInfo.new(7),{["Position"] = Elevator.Cart.Special.Car.Position - Vector3.new(0,31,0)}):Play()
task.wait(10)
doorElevaotr:Play(0)
task.wait(doorElevaotr.Length)
doorElevaotr:Stop(0)
Elevator.Cart.Door1.Transparency = 1
for i, v in pairs(Elevator.Cart.Door1:GetChildren()) do
if v:IsA("Texture") then
v.Transparency = 1
end
end
Elevator.Cart.Door1.CanCollide = false
Elevator.Cart.Door2.Transparency = 1
for i, v in pairs(Elevator.Cart.Door2:GetChildren()) do
if v:IsA("Texture") then
v.Transparency = 1
end
end
Elevator.Cart.Door2.CanCollide = false
end
end
function PickUp_Anomaly(character,plr)
if game.ReplicatedStorage.Values.Scavenging.Scavenged_Has.Value < game.ReplicatedStorage.Values.Scavenging.Scavenged_Need.Value then
--[[print("Color Is : ".. Anomalies_List[character.Name].Color)
print("Desc : ".. Anomalies_List[character.Name].Desc)
print("Difficulty Is : ".. Anomalies_List[character.Name].Difficulty)
print(Anomalies_List[character.Name].Price .. "$")]]
character:FindFirstChild("Torso"):FindFirstChildOfClass("ProximityPrompt").Enabled = false
game.ReplicatedStorage:WaitForChild("Events"):WaitForChild("Scavenge_Event"):FireClient(plr,"SetCamera",workspace:WaitForChild("Location_Map"):FindFirstChildOfClass("Folder"):WaitForChild("Cameras"):FindFirstChild(character.Name))
plr.Character.HumanoidRootPart.Anchored = true
local pos = character.PrimaryPart.Position+ character.PrimaryPart.CFrame.LookVector*character:FindFirstChild("Settings"):FindFirstChild("CloseValue").Value
plr.Character.PrimaryPart.CFrame = CFrame.new(pos,character.PrimaryPart.Position)
task.wait(1)
game.ReplicatedStorage:WaitForChild("Events"):WaitForChild("Dialogue_Event"):FireClient(plr,"StartDialogue",character)
--[[character:Destroy()
local bool = Instance.new("BoolValue")
bool.Parent = game.ReplicatedStorage.Values.Anomalies_Picked
bool.Name = character.Name
if game.ReplicatedStorage.Values.Scavenging.Scavenged_Has.Value >= game.ReplicatedStorage.Values.Scavenging.Scavenged_Need.Value then
print("tp to office")
Office_Teleportation()
end]]
end
end
function Office_Teleportation()
game.ReplicatedStorage.Values.Scavenging.Value = false
game.ReplicatedStorage.Values.Office.Value = true
for i, locat in pairs(workspace.Location_Map:GetChildren()) do
if locat:IsA("Folder") then
locat:Destroy()
end
end
for i, plr in pairs(game.Players:GetPlayers()) do
plr.Character.PrimaryPart.CFrame = workspace:WaitForChild("Office"):FindFirstChild("Spawn").CFrame
end
OfficeModule.StartNigth()
end
function scavenge.KidnapChar(character)
game.ReplicatedStorage.Values.Scavenging.Scavenged_Has.Value += 1
game.ReplicatedStorage.Values.Cash.Value += Anomalies_List[character.Name].ActualPrice
character:Destroy()
local bool = Instance.new("BoolValue")
bool.Parent = game.ReplicatedStorage.Values.Anomalies_Picked
bool.Name = character.Name
local AngerLvl = Instance.new("NumberValue")
AngerLvl.Parent = bool
AngerLvl.Name = "Anger"
if game.ReplicatedStorage.Values.Scavenging.Scavenged_Has.Value >= game.ReplicatedStorage.Values.Scavenging.Scavenged_Need.Value then
game.ReplicatedStorage.Events.Dialogue_Event:FireAllClients("End")
for i, anomalies in pairs(workspace.Location_Map:FindFirstChildOfClass("Folder"):FindFirstChild("Anomalies"):GetChildren()) do
if anomalies:IsA("Model") then
anomalies.Torso.ProximityPrompt.Enabled = false
end
end
if game.ReplicatedStorage.Values.Scavenging.AreaIn.Value == "Area-51" then
workspace.Location_Map:FindFirstChildOfClass("Folder"):FindFirstChild("Morket").Cart.Special.up:FindFirstChild("ClickDetector").MaxActivationDistance = 32
workspace.Location_Map:FindFirstChildOfClass("Folder"):FindFirstChild("Morket").Cart.Special.up:FindFirstChild("ClickDetector").MouseClick:Connect(function()
warn("apapa")
local Elevator = workspace.Location_Map:FindFirstChildOfClass("Folder").Morket
local doorElevaotr = Elevator.Humanoid:LoadAnimation(Elevator.Configuration.Close)
workspace.Location_Map:FindFirstChildOfClass("Folder"):FindFirstChild("Morket").Cart.Special.up:FindFirstChild("ClickDetector").MaxActivationDistance = 0
task.wait(1)
doorElevaotr:Play(0)
Elevator.Cart.Door1.Transparency = 0
for i, v in pairs(Elevator.Cart.Door1:GetChildren()) do
if v:IsA("Texture") then
v.Transparency = 0
end
end
Elevator.Cart.Door1.CanCollide = true
Elevator.Cart.Door2.Transparency = 0
for i, v in pairs(Elevator.Cart.Door2:GetChildren()) do
if v:IsA("Texture") then
v.Transparency = 0
end
end
Elevator.Cart.Door2.CanCollide = true
task.wait(doorElevaotr.Length)
doorElevaotr:Stop(0)
game.TweenService:Create(Elevator.Cart.Special.Car,TweenInfo.new(7),{["Position"] = Elevator.Cart.Special.Car.Position + Vector3.new(0,31,0)}):Play()
task.wait(4)
game.ReplicatedStorage.Events:WaitForChild("Scavenge_Event"):FireAllClients("Ended")
task.wait(2)
Office_Teleportation()
end)
end
end
end
return scavenge
-- Office module
local office = {}
local DoorSpeedClose = 0.15
local DoorSwitchClose = 0.35
local DoorSpeedOpen = 1
local DoorDownWaitingTime = 5
local Mobs = require(game.ReplicatedStorage:FindFirstChild("Modules"):FindFirstChild("Mobs_Ai"))
function office.Setup()
print("odl")
workspace.OfficeOld:Destroy()
for i, models in pairs(workspace.Office.Interactible:GetChildren()) do
if models:IsA("Model") then
local prox = Instance.new("ProximityPrompt")
prox.Parent = models.PrimaryPart
prox.HoldDuration = .02
if models:FindFirstChild("Lever") then
prox.Triggered:Connect(function()
if prox.Parent:FindFirstChild("Config").DoorIsOn.Value == "MetalDoor2" then
prox.Parent:FindFirstChild("Config").DoorIsOn.Value = "MetalDoor1"
game.TweenService:Create(workspace:FindFirstChild("Office"):FindFirstChild("Interactible").Doors["Metal Door1"].PrimaryPart,TweenInfo.new(DoorSwitchClose,Enum.EasingStyle.Quad),{["CFrame"] = prox.Parent:FindFirstChild("Config").MetalDoor1_Closed.Value}):Play()
task.wait(.15)
game.TweenService:Create(workspace:FindFirstChild("Office"):FindFirstChild("Interactible").Doors["Metal Door2"].PrimaryPart,TweenInfo.new(DoorSwitchClose,Enum.EasingStyle.Quad),{["CFrame"] = prox.Parent:FindFirstChild("Config").MetalDoor2_Open.Value}):Play()
else
prox.Parent:FindFirstChild("Config").DoorIsOn.Value = "MetalDoor2"
game.TweenService:Create(workspace:FindFirstChild("Office"):FindFirstChild("Interactible").Doors["Metal Door1"].PrimaryPart,TweenInfo.new(DoorSwitchClose,Enum.EasingStyle.Quad),{["CFrame"] = prox.Parent:FindFirstChild("Config").MetalDoor1_Open.Value}):Play()
task.wait(.15)
game.TweenService:Create(workspace:FindFirstChild("Office"):FindFirstChild("Interactible").Doors["Metal Door2"].PrimaryPart,TweenInfo.new(DoorSwitchClose,Enum.EasingStyle.Quad),{["CFrame"] = prox.Parent:FindFirstChild("Config").MetalDoor2_Closed.Value}):Play()
end
end)
else
prox.Triggered:Connect(function()
local Door = prox.Parent:FindFirstChild("Config"):FindFirstChild("Door").Value
if prox.Parent:FindFirstChild("Config").Closed.Value == false then
game.TweenService:Create(Door.PrimaryPart,TweenInfo.new(DoorSpeedClose,Enum.EasingStyle.Quad),{["Position"] = prox.Parent:FindFirstChild("Config").OriginalCFrameDown.Value}):Play()
prox.Parent:FindFirstChild("Config").Closed.Value = true
prox.Parent.Color = Color3.fromRGB(118, 0, 0)
if not prox.Parent.Parent:FindFirstChild('Vent') then
task.wait(DoorDownWaitingTime/2)
print("soon")
task.wait(DoorDownWaitingTime/2)
if prox.Parent:FindFirstChild("Config").Closed.Value == true then
print("open")
game.TweenService:Create(Door.PrimaryPart,TweenInfo.new(DoorSpeedOpen,Enum.EasingStyle.Exponential),{["Position"] = prox.Parent:FindFirstChild("Config").OriginalCFrameUp.Value}):Play()
prox.Parent:FindFirstChild("Config").Closed.Value = false
prox.Parent.Color = Color3.fromRGB(44, 101, 29)
end
end
else
game.TweenService:Create(Door.PrimaryPart,TweenInfo.new(DoorSpeedOpen,Enum.EasingStyle.Exponential),{["Position"] = prox.Parent:FindFirstChild("Config").OriginalCFrameUp.Value}):Play()
prox.Parent:FindFirstChild("Config").Closed.Value = false
prox.Parent.Color = Color3.fromRGB(44, 101, 29)
end
end)
end
end
end
end
function EndOfNight()
--ScavengeModule.Start("Retro")
end
function office.StartNigth()
--Config
game.Lighting.ClockTime = 0
game.Lighting.Ambient = Color3.fromRGB(100,100,100)
game.Lighting.EnvironmentDiffuseScale = 0.5
game.Lighting.EnvironmentSpecularScale = 0.25
game.Lighting.OutdoorAmbient = Color3.fromRGB(0, 0, 0)
local Timer = 0
if game.Lighting:FindFirstChildOfClass("Sky") then
game.Lighting:FindFirstChildOfClass("Sky"):Destroy()
end
if game.Lighting:FindFirstChildOfClass("ColorGradingEffect") then
game.Lighting:FindFirstChildOfClass("ColorGradingEffect"):Destroy()
end
for i, folders in pairs(workspace.Office.Lights:GetChildren()) do
if folders:IsA("Folder") then
if folders.Name ~= "Special_Lights" then
for i, lights_instances in pairs(folders:GetDescendants()) do
if lights_instances:IsA("Beam") or lights_instances:IsA("PointLight") then
lights_instances.Enabled = false
end
if lights_instances:IsA("Part") then
lights_instances.Color = Color3.fromRGB(0,0,0)
end
end
end
end
end
for i, anomalies in pairs(game.ReplicatedStorage.Values.Anomalies_Picked:GetChildren()) do
Mobs.Activate(anomalies.Name)
end
for i = 1,6 do
Timer = i
print(i)
task.wait(5)
end
print("end")
for i, u in pairs(workspace.Mobs:GetChildren()) do
if u:IsA("Model") then
u:Destroy()
end
end
game.ReplicatedStorage.Values.Office.NightEnded.Value = true
end
while task.wait(.5) do
local numbersOfVentsClosed = 0
if workspace.Office.Interactible.VentDoor.Button.Config.Closed.Value == true then
numbersOfVentsClosed += 1
end
if numbersOfVentsClosed >= 1 then
game.ReplicatedStorage.Values.Office.Temperature.Value += numbersOfVentsClosed
else
if game.ReplicatedStorage.Values.Office.Temperature.Value > 20 then
game.ReplicatedStorage.Values.Office.Temperature.Value -= 1
end
end
workspace.Office.Interactible.Misc.Temperature.Screen.SurfaceGui.TextLabel.Text = game.ReplicatedStorage.Values.Office.Temperature.Value
end
return office
-- server script
workspace.Button.ProximityPrompt.Enabled = false
print("a")
for i = 1,5 do
print(i)
task.wait(1)
end
local ScavengeModule = require(game.ReplicatedStorage.Modules.Scavenging) -- ERROR SCRIPT
local OfficeModule = require(game.ReplicatedStorage.Modules.Office) -- ERROR SCRIPT
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local Anomalies_List = require(ReplicatedStorage:FindFirstChild("Modules"):FindFirstChild("Scavenging"):FindFirstChild("Anomalies_List"))
local Mobs = require(ReplicatedStorage:FindFirstChild("Modules"):FindFirstChild("Mobs_Ai"))
OfficeModule.Setup()
ScavengeModule.Start("Area-51")
workspace.Button.ProximityPrompt.Enabled = true
print("a")
workspace.Button.ProximityPrompt.Triggered:Connect(function(plr)
print("aweltfjkweropkgweropjkgwerj")
end)
ReplicatedStorage:WaitForChild("Events"):WaitForChild("Scavenge_Event").OnServerEvent:Connect(function(plr,bool1,bool2)
if bool1 == "Yes" then
for i, plr in pairs(game.Players:GetPlayers()) do
if plr.PlayerGui:WaitForChild("Ui"):WaitForChild("ScavengingUi"):WaitForChild("Characters"):WaitForChild("Character1").ImageLabel.Image == "" then
plr.PlayerGui:WaitForChild("Ui"):WaitForChild("ScavengingUi"):WaitForChild("Characters"):WaitForChild("Character1").ImageLabel.Image = Anomalies_List[bool2.Name].Image
elseif plr.PlayerGui:WaitForChild("Ui"):WaitForChild("ScavengingUi"):WaitForChild("Characters"):WaitForChild("Character2").ImageLabel.Image == "" and plr.PlayerGui:WaitForChild("Ui"):WaitForChild("ScavengingUi"):WaitForChild("Characters"):WaitForChild("Character1").ImageLabel.Image ~= "" then
plr.PlayerGui:WaitForChild("Ui"):WaitForChild("ScavengingUi"):WaitForChild("Characters"):WaitForChild("Character2").ImageLabel.Image = Anomalies_List[bool2.Name].Image
elseif plr.PlayerGui:WaitForChild("Ui"):WaitForChild("ScavengingUi"):WaitForChild("Characters"):WaitForChild("Character3").ImageLabel.Image == "" and plr.PlayerGui:WaitForChild("Ui"):WaitForChild("ScavengingUi"):WaitForChild("Characters"):WaitForChild("Character1").ImageLabel.Image ~= "" and plr.PlayerGui:WaitForChild("Ui"):WaitForChild("ScavengingUi"):WaitForChild("Characters"):WaitForChild("Character2").ImageLabel.Image ~= ""then
plr.PlayerGui:WaitForChild("Ui"):WaitForChild("ScavengingUi"):WaitForChild("Characters"):WaitForChild("Character3").ImageLabel.Image = Anomalies_List[bool2.Name].Image
end
end
ScavengeModule.KidnapChar(bool2)
task.wait(1)
plr.Character.HumanoidRootPart.Anchored = false
elseif bool1 == "No" then
task.wait(1)
plr.Character.HumanoidRootPart.Anchored = false
bool2:FindFirstChild("Torso"):FindFirstChildOfClass("ProximityPrompt").Enabled = true
end
end)
Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.