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

Why isn't my script not forcing first person mode?

Asked by 4 years ago
Edited 4 years ago

This script is suppose to change the camera to first person and the other line is suppose to change the character walkspeed to 14 using a part and I need it to stay that way even if the player leaves the touching area of the part but after the player touches the part, it's not changing the walk speed or the camera distance and there's no error coming out in Output. Any help would be appreciated.

local function onTouched(part)
    local h = part.Parent:FindFirstChild("Humanoid")
    local speed = game.StarterPlayer
    local FPS = game.StarterPlayer
    if h then
    speed.CharacterWalkSpeed = 14
    FPS.CameraMaxZoomDistance = 0.5
    end
end
script.Parent.Touched:connect(onTouched)

Note: No, don't tell me to just use the properties in StarterPlayer instead of a script because I have several parts that the player needs to touch that changes their walkspeed and camera distance.

0
Make a varible for the character humanoid and then make speed a varible for the humanoid walkspeed kevinsoaresv 47 — 4y
0
uh what Simpletton 82 — 4y

Answer this question