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

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

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.

10 comments

0

Error message?

1

@terence404 There obviously is no error message.

0

@terence404 why would there be?

0

try filtering enbabled

0

If I used filtering enabled my stuff would be ruined... :I

0

Then why even make a game if it isn't FE?

0

It's none of your business, I just want my script to work.

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.

0

I got it fixed

0

I once experienced this thingy

1 answer

Vector3.new(
    0, 
    h.Parent.UpperTorso.Velocity.Y,
IDK WHAT Z WAS 
)

Format line 6 like that to make it readable.

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