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

:MoveTo not working in online mode?

Asked by
Omarstein 100
9 years ago
repeat wait() until game.Players:FindFirstChild("CurrentPlayer")
local player = game.Players.CurrentPlayer
print(player.Value)
local chr
function appear()
    cln = game.ServerStorage:FindFirstChild(""):Clone()
    cln.Parent = game.Workspace
    chr = game.Workspace:FindFirstChild(player.Value).Torso
    cln:MoveTo(chr.Position + chr.CFrame.lookVector*15)
    cln.Monster.WalkSpeed = 10
    cln.Monster:MoveTo(chr.Position, chr)
    wait(1)
    cln.Monster.WalkSpeed = 0
end

function disappear()
    cln:Destroy()
end

while wait(math.random(5,25)) do
    appear()
    wait(2)
    disappear()
end

So I just created this script which should clone a monster from ServerStorage and put him in Workspace, this part works perfectly. The monster should then walk toward the player for a second and stop, this part doesn't work. The player variable is correct its value is the player's name... any suggestions?

0
Is CurrentPlayer a value in Players? Spongocardo 1991 — 9y
0
@spongocardo yes it is Omarstein 100 — 9y
0
Are there errors? You currently have no error checking in the event that there isn't any Character model with the name "player.Value"; or in the event that there is, that they do infact have a Torso. BlueTaslem 18071 — 9y

Answer this question