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

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

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

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

1 comment

0

yay someone who knows why this errors

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