Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Disable swim in terrain water? [SOLVED]

Asked by
imaA6D 39
3 years ago
Edited 3 years ago

[SOLVED] Putting it in StarterGui.

I found this script where you can't swim in terrain water

local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:wait()
local hum = char:WaitForChild("Humanoid")

hum:SetStateEnabled(Enum.HumanoidStateType.Swimming, false)

It works, but whenever I reset, it doesn't work anymore. Any help?

0
where is this localscript located ? VerdommeMan 1479 — 3y

2 answers

Log in to vote
0
Answered by
raid6n 2196 Moderation Voter Community Moderator
3 years ago
Edited 3 years ago

do a while wait() loop.

local plr = game.Players.LocalPlayer
local char = plr.Character or plr.CharacterAdded:wait()
local hum = char:WaitForChild("Humanoid")

while wait() do
hum:SetStateEnabled(Enum.HumanoidStateType.Swimming, false)
end
0
Tried it, doesn't work. imaA6D 39 — 3y
0
Could you be more specific instead of saying, "Didn't work.", it would be be awesome if you told me if it did the same thing, nothing, or showed an output error. raid6n 2196 — 3y
0
Theres no error, doesn't say one. imaA6D 39 — 3y
0
If it doesn't work, then it's either the wrong script or the wrong location. sngnn 274 — 3y
0
I put it in a LocalScript under StarterPlayerScripts. imaA6D 39 — 3y
Ad
Log in to vote
0
Answered by
imaA6D 39
3 years ago

I fixed it by putting it in StarterGui, but thanks for the people that tried helping.

Answer this question