Remove Forcefield when walking

True, there might be a problem with how you defined humanoid.

local Humanoid = Character:WaitForChild(“Humanoid”)

Also please tell how you defined character if possible

i dont have character defined.

well ok, then but the problem is with line 1 of the script but go check capitalization and check if it is run instead of running

the running part is,

Running

You don’t need a script and I think it is impossible to use destroy on it, in all SpawnLocation, change Duration to 0.
You can also do that and create it to change the parent at the right time.

From all your spawnlocations property, set ForceField Duration to 0. In StarterCharacterScripts, you can put in this script.

local Humanoid = script.Parent:WaitForChild("Humanoid", 5)

local ForceField = Instance.new("ForceField")
ForceField.Parent = script.Parent

Humanoid:GetPropertyChangedSignal("MoveDirection"):Wait()

ForceField:Remove()
script:Remove()

The script above is untested, but it should work. Humanoid’s move direction changes whenever the humanoid starts moving.

2 Likes

when i try to spawn it it will spawn me without forcefield

You spelt local humanoid = scipt

It actually is

local humanoid = script.Parent:WaitForChild(“Humanoid”, 5)

i get a issue with
ServerScriptService.Script:4: attempt to index nil with ‘Parent’

Are you sure you put it in StarterCharacterScripts…? You can find it in game > StarterPlayer > StarterCharacterScripts.

oh i thought to put it into server script service

but the same error will continue if i put it there

Weird, can you show me a screenshot of where the script is?

image
the script is the local script in starter character scripts

Should be a Server Script not LocalScript.

I have all that down but the issue is still with

ForceField.Parent = script.Parent

Sorry, I made a little typing mistake there. Copy the script from above again and run it.

1 Like

it works now, thank you so much