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

Why does this float script work in studio but not ingame? My title is specific

Asked by 5 years ago

The script makes an R15 player float on water, but you just get trapped beneath the surface. The game has filtering enabled disabled by the way.

function onTouched(part)
    if part.Parent ~= nil then
        local h = part.Parent:findFirstChild("Humanoid")
            if h~=nil then
if  (h.Parent.UpperTorso.Velocity.y < 5) then
h.Parent.UpperTorso.Velocity=Vector3.new(0,h.Parent.UpperTorso.Velocity.y+.7,0)
wait()
end

            end         
    end
end

script.Parent.Touched:connect(onTouched)

Thanks if you can help me.

0
Error message? terence404 19 — 5y
1
@terence404 There obviously is no error message. oreoollie 649 — 5y
0
@terence404 why would there be? CaptainAlien132 225 — 5y
0
try filtering enbabled MoonWolfiee -14 — 5y
View all comments (6 more)
0
If I used filtering enabled my stuff would be ruined... :I CaptainAlien132 225 — 5y
0
Then why even make a game if it isn't FE? Enomphia 39 — 5y
0
It's none of your business, I just want my script to work. CaptainAlien132 225 — 5y
0
Your code gets cut off, can you make line 6 look like my answer? I will edit it to a legitimate answer once I see the numbers. User#19524 175 — 5y
0
I got it fixed CaptainAlien132 225 — 5y
0
I once experienced this thingy cherrythetree 130 — 5y

1 answer

Log in to vote
0
Answered by 5 years ago
Vector3.new(
    0, 
    h.Parent.UpperTorso.Velocity.Y,
IDK WHAT Z WAS 
)

Format line 6 like that to make it readable.

Ad

Answer this question