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

Petsystem doesn't work because end is not expected identifier?

Asked by 6 years ago

This is my script

repeat wait()until game.Players.LocalPlayer and game.Players.LocalPlayer.Character
print("Pet Controller Loaded")

function MovePet(pet,mode)
 local character = game.Players.LocalPlayer.Character
 local rpet = workspace[pet]
 local rmode = mode
 local inc = 0.7

 if mode == true then -- if this is true then make the pet float
  local base = character['Head']
  local dir = CFrame.new(rpet.Position, base.Position).lookVector
  print(dir)
  for i= 0,10,2 do
   rpet.CFrame = rpet.CFrame + (dir * inc)
   wait(0.05)
  end
else -- If its anything else other then true then make the pet go on the ground
 local base = character['Left Foot']
local dir = CFrame.new(rpet.Position, base.Position).lookVector
  print(dir)
  for i= 0,10,2 do
   rpet.CFrame = rpet.CFrame + (dir * inc)
   wait(0.05)
  end
 end
end

while wait() do
 MovePet("Pet", false) 
end?

This is my error Player.Entirely76.PlayerGui.PetController:31: unexpected symbol near '

1 answer

Log in to vote
0
Answered by 6 years ago

Try removing the '?' On line 31. while wait() do MovePet("Pet", false) end?

0
yay someone who knows why this errors hiimgoodpack 2009 — 6y
Ad

Answer this question