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

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

Asked by
XIqm 0
6 years ago
Edited 6 years ago
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

0
Is your character R6 in studio and R15 in game? User#20279 0 — 6y

2 answers

Log in to vote
0
Answered by 6 years ago

FindFirstChild not findFirstChild. It's deprecated + misspelt

Ad
Log in to vote
-1
Answered by
oftenz 367 Moderation Voter
6 years ago

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

1
That's irrelevant, :connect still works fine. Le_Teapots 913 — 6y
0
Using deprecated code can cause problems. I didn't see any other issues so I automatically thought of this. oftenz 367 — 6y
0
It works in a playtest, it doesn't work when I head in a server in a game XIqm 0 — 6y

Answer this question