currydude
|
  |
| Joined: 06 Dec 2008 |
| Total Posts: 656 |
|
|
| 29 Dec 2013 11:21 AM |
I'm having a bit of trouble at the moment CFraming characters to their destination in my game Lambda;
I have quite a lengthy script that sets up where the player has to go and automates things around them, but when the character is moved to the position they don't appear to move, however when in server viewing mode they have moved.
tl;dr Player does CFrame, but only on server side, not client side. |
|
|
| Report Abuse |
|
|
currydude
|
  |
| Joined: 06 Dec 2008 |
| Total Posts: 656 |
|
| |
|
currydude
|
  |
| Joined: 06 Dec 2008 |
| Total Posts: 656 |
|
| |
|
currydude
|
  |
| Joined: 06 Dec 2008 |
| Total Posts: 656 |
|
|
| 06 Jan 2014 05:07 AM |
| Again, still no reply from anyone... Any help that leads to the resolving will be rewarded! |
|
|
| Report Abuse |
|
|
smiley599
|
  |
| Joined: 23 Jan 2010 |
| Total Posts: 21869 |
|
| |
|
jakej78b
|
  |
| Joined: 09 Mar 2011 |
| Total Posts: 813 |
|
|
| 06 Jan 2014 06:37 AM |
| Agreed, we are scripting helpers. No script = no help. If it helps just use a portion of the script that you think is the problem. |
|
|
| Report Abuse |
|
|
|
| 06 Jan 2014 07:46 AM |
| To move a player just simply cframe their torso. Do not Position it. Only cframe, or you will kill them. |
|
|
| Report Abuse |
|
|
currydude
|
  |
| Joined: 06 Dec 2008 |
| Total Posts: 656 |
|
|
| 06 Jan 2014 08:00 AM |
Here is the script;
--Defining stuff here config = script.Parent.Configuration player = script.Parent.Parent.Parent.Parent.Parent torso = script.Parent.Parent.Parent.Parent.Parent.Character.Torso arenatype = config.Arena.Value enemy = config.EnemyName.Value arena = game.Workspace.Arenas:findFirstChild(arenatype) --player = script.Parent.Parent.Parent.Parent.Parent arenaselected = script.Parent.ArenaSelected.Value
function Click() torso.Parent.Humanoid.WalkSpeed = 0 --execute here if arena.Arena1.InUse.Value == false then -- redundant player:MoveTo(arena.Arena1.Player.Position) arena.Arena1.InUse.Value = true arenaselected = ("Arena1") statsforgui = config:clone() statsforgui.Parent = player.PlayerGui.Master.Fight.EnemyStats
torso.CFrame = arena.Arena1.Player.CFrame + Vector3.new(0, 0.01, 0) -- torso.CFrame = CFrame.new(arena.Arena1.Player.Position) -- torso.CFrame = torso.CFrame * CFrame.fromEulerAnglesXYZ(0,math.rad(180),0) torso.Anchored = true fighting()
elseif arena.Arena2.InUse.Value == false then arena.Arena1.InUse.Value = true arenaselected = ("Arena2") statsforgui = config:clone() statsforgui.Parent = player.PlayerGui.Master.Fight.EnemyStats -- torso.CFrame = CFrame.new(arena.Arena2.Player.Position) -- torso.CFrame = CFrame.new.fromEulerAnglesXYZ(0, 180, 0) torso.Anchored = true fighting() --need to script a waiting to fight function in here, replace this with whiletruedo function to loop else print("No Arenas Free") torso.Anchored = false torso.Parent.Humanoid.WalkSpeed = 16
end end
script.Parent.MouseButton1Down:connect(Click)
function fighting()
monsterclone = game.Lighting.Enemies:findFirstChild(enemy):clone() monsterclone.Parent = game.Workspace monsterclone.Torso.CFrame = CFrame.new(arena:findFirstChild(arenaselected).Enemy.Torso.Position) monsterclone.LeftArm.CFrame = CFrame.new(arena:findFirstChild(arenaselected).Enemy.LeftArm.Position) monsterclone.RightArm.CFrame = CFrame.new(arena:findFirstChild(arenaselected).Enemy.RightArm.Position) monsterclone.LeftLeg.CFrame = CFrame.new(arena:findFirstChild(arenaselected).Enemy.LeftLeg.Position) monsterclone.RightLeg.CFrame = CFrame.new(arena:findFirstChild(arenaselected).Enemy.RightLeg.Position) monsterclone.Head.CFrame = CFrame.new(arena:findFirstChild(arenaselected).Enemy.Head.Position)
monsterclone.Torso.Anchored = true monsterclone.Name = (arena.Name..arenaselected.."Enemy") config.ActualEnemyName.Value = (arena.Name..arenaselected.."Enemy") -- statsforgui = config:clone() -- statsforgui.Parent = player.PlayerGui.Master.Fight.EnemyStats
end
|
|
|
| Report Abuse |
|
|
currydude
|
  |
| Joined: 06 Dec 2008 |
| Total Posts: 656 |
|
|
| 06 Jan 2014 08:01 AM |
torso.CFrame = arena.Arena1.Player.CFrame + Vector3.new(0, 0.01, 0)
This bit more specifically... What happens in server/ client mode is that the server sees the player move but the client window does not :/ |
|
|
| Report Abuse |
|
|
currydude
|
  |
| Joined: 06 Dec 2008 |
| Total Posts: 656 |
|
|
| 06 Jan 2014 08:04 AM |
| Also yes I am using the Lighting still... I am backwards like that... |
|
|
| Report Abuse |
|
|
currydude
|
  |
| Joined: 06 Dec 2008 |
| Total Posts: 656 |
|
| |
|
currydude
|
  |
| Joined: 06 Dec 2008 |
| Total Posts: 656 |
|
| |
|