Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Disable swim in terrain water? [SOLVED]

[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?

1 comment

0

where is this localscript located ?

2 answers

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

5 comments

0

Tried it, doesn't work.

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.

0

Theres no error, doesn't say one.

0

If it doesn't work, then it's either the wrong script or the wrong location.

0

I put it in a LocalScript under StarterPlayerScripts.

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

This discussion is preserved as it was. New answers, comments, and votes are closed.