I have been trying to make so if a Value is = “Stormy” then the players starts blowing away in
a random direction.
But I haven’t gotten it to work!
I’ve been looking ALOT about BodyVelocity and BodyForce Which is was I’m working with atm.
I haven’t got it to work, Any help is Amazing!
-- SCRIPT 1!!
-- Variables.
local x = workspace.GroundParts:GetChildren()
local condition = game.ReplicatedStorage.MainStuff.Weather
local WA = 10
local PlayerInWorld = game.ReplicatedStorage.MainStuff.PlayerInWorld
local players = game:GetService("Players")
local WO = game.ReplicatedStorage.MainStuff.WindOn
-- Conditions.
local Conditions = {
A = " ☀️ Sunny ☀️",
B = " ❄️ Snowing ❄️",
C = " 🌨️ Hailling 🌨️",
D = " 🌧️ Raining 🌧️",
E = " ⛈️ Stormy ⛈️",
F = " 🌪️ Tornado 🌪️",
G = " 🌫️ Foggy 🌫️",
}
-- Functions.
local function Fog()
game.Lighting.FogEnd = 100
game.Lighting.FogColor = Color3.new(0.423529, 0.423529, 0.423529)
game.Lighting.FogStart = 10
end
local function FogEnd()
game.Lighting.FogEnd = 10000000000
game.Lighting.FogColor = Color3.new(0.423529, 0.423529, 0.423529)
game.Lighting.FogStart = 10000000000
end
local function Rain()
local R = game.ReplicatedStorage.MainStuff.Rainclouds:GetChildren()
for i, x in pairs(R) do
local RC = x:Clone()
RC.Parent = game.Workspace.Clouds
RC.Name = "RainClouds"
end
end
local function RainEnd()
game.Workspace.Clouds:ClearAllChildren()
end
-- Script.
while wait(WA) do
local NewCondition = math.random(1, 6)
print(NewCondition)
if NewCondition == 1 then
condition.Value = Conditions.A
FogEnd()
RainEnd()
for i, part in pairs(x) do
part.Material = "Plastic"
part.CustomPhysicalProperties = PhysicalProperties.new(0.7, 1, 0.5, 1, 1)
end
end
if NewCondition == 2 then
condition.Value = Conditions.B
FogEnd()
RainEnd()
for i, part in pairs(x) do
part.Material = "Plastic"
wait(.3)
part.CustomPhysicalProperties = PhysicalProperties.new(0.7, 0, 0.6, 30, 1)
end
end
if NewCondition == 3 then
condition.Value = Conditions.C
FogEnd()
RainEnd()
for i, part in pairs(x) do
part.Material = "Plastic"
wait(.3)
part.CustomPhysicalProperties = PhysicalProperties.new(0.7, 0, 0.6, 15, 1)
end
end
if NewCondition == 4 then
condition.Value = Conditions.D
FogEnd()
Rain()
for i, part in pairs(x) do
part.Material = "Plastic"
wait(.3)
part.CustomPhysicalProperties = PhysicalProperties.new(0.7, 0, 0.6, 45, 1)
end
end
if NewCondition == 5 then
condition.Value = Conditions.E
FogEnd()
Rain()
game.ReplicatedStorage.MainStuff.WindOn:FireClient()
for i, part in pairs(x) do
part.Material = "Plastic"
part.CustomPhysicalProperties = PhysicalProperties.new(0.7, 1, 0.5, 1, 1)
end
end
end
-- SCRIPT 2!!
-- Variables.
local WO = game.ReplicatedStorage.MainStuff.WindOn
local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:Wait()
local Root = char:FindFirstChild("HumanoidRootPard")
-- Script
WO.OnClientEvent:Connect(function()
local x = Instance.new("BodyForce")
x.Parent = Root
x.Name = "BodyForce"
local direction = math.random(1, 4)
if direction == 1 then
x.Force = Vector3.new(1, 0, 0)
end
if direction == 2 then
x.Force = Vector3.new(-1, 0, 0)
end
if direction == 3 then
x.Force = Vector3.new(0, 0, -1)
end
if direction == 4 then
x.Force = Vector3.new(0, 0, 1)
end
end)
ANY HELP IS AMAZING, I’M VERY THANKFUL!!!