How do I make Wind that blows the player Slowly but the player can fight against?

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!!!

You need to put in the FireClient() a parameter that is the player.
WindOn:FireClient(player)

1 Like

you have to use :FireAllClients()

1 Like

Doesn’t work, hmmm. But thanks anyways!

1st script is a “Script” the other one is a “LocalScript”

does it stilll have the bug on line 101? if it doesn’t it has something to do with your force calculations.

I don’t have the error anymore, so yeah. Do u know the error with the Force calculations?

I think the forcce is simply not enoguh, try changing it to like 10

2 Likes

Seems in script 2 you’ve misspelled “HumanoidRootPart”, when defining Root

2 Likes

Already tried, Doesn’t help! Thanks anyways!

Oh shi, didn’t notice! I’ll try that! Thanks

Still Doesn’t work! Didn’t even add the BodyForce.

where is the localscript? If you put it in StarterPlayerScripts it should work…

1 Like

Still doesnt work, I can’t figure out, It’s not even making the BodyForce.

try putting a print before u make it just to make sure the code is running

2 Likes

Imma try this.

– Variables.

print(“Getting Variables.”)

local WO = game.ReplicatedStorage.MainStuff.WindOn

local plr = game.Players.LocalPlayer

local char = plr.Character or plr.CharacterAdded:Wait()

local Root = char:FindFirstChild(“HumanoidRootPart”)

print(“Beginning the script.”)

– Script

WO.OnClientEvent:Connect(function()

print(“WO is on a Client Event.”)

local x = Instance.new(“BodyForce”)

x.Parent = Root

x.Name = “BodyForce”

local direction = math.random(1, 4)

print("Direction: " … direction)

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

print(“Done.”)

end)

Got these.

This is weird Imo, It didn’t say “Getting Variables.”

Never Mind it did, I’m just blind. Still doesn’t move the character

did u increase the force value?

yup, still doesnt even make it.
I can’t see any errors which is SUPER weird