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

Script only working in studio and not ingame, How do I fix this? It's a launchpad also.

function onTouched(part)
	if part.Parent ~= nil then
		local h = part.Parent:findFirstChild("Humanoid")
			if h~=nil then
				
h.Parent.Torso.Velocity=Vector3.new(0,500,800)
wait(0.5)

			end			
	end
end

script.Parent.Touched:connect(onTouched)

This script is like a launch pad that launches the player, but it is only working in studio and not ingame FE is off

2 comments

0

Is your character R6 in studio and R15 in game?

2 answers

FindFirstChild not findFirstChild. It's deprecated + misspelt

Use script.Parent.Touched:Connect(onTouched) instead of a lowercase c. *Deprecated

3 comments

1

That's irrelevant, :connect still works fine.

0

Using deprecated code can cause problems. I didn't see any other issues so I automatically thought of this.

0

It works in a playtest, it doesn't work when I head in a server in a game

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