djboy
|
  |
| Joined: 16 Mar 2008 |
| Total Posts: 794 |
|
|
| 07 Mar 2015 04:04 PM |
So i made this script and for some reason i keep respawning over and over... but i do not know what is going on.. Basicly the script says: "When the player spawns and they do not have a wand in there character then set there character to "BLANK", But if they spawn and they do have a wand just do nothing.." but for some reason it keeps making a new character over and over.... someone help
-------
game.Players.PlayerAdded:connect(function(Player) Player.CharacterAdded:connect(function(Character) wait(2) if Character:FindFirstChild("Wand") then print("There is a wand") elseif Character:FindFirstChild("Wand") == nil then print("There is no wand") Char = game.ReplicatedStorage.Dummy:clone() Char.Parent = game.Workspace Char.Name = Player.Name Player.Character = Char wait(1) if not Player.Backpack:FindFirstChild("LocalScript") then game.ReplicatedStorage.LocalScripts.LocalScript:clone().Parent = Player.Backpack end end end) end)
------- |
|
|
| Report Abuse |
|
|
djboy
|
  |
| Joined: 16 Mar 2008 |
| Total Posts: 794 |
|
| |
|
djboy
|
  |
| Joined: 16 Mar 2008 |
| Total Posts: 794 |
|
| |
|
KAAK82
|
  |
| Joined: 06 May 2014 |
| Total Posts: 1166 |
|
|
| 07 Mar 2015 04:18 PM |
thats cos I think ur 1st Checking for the Wand and THEN u Make a New Character for the Player :P
u gotta do the Opposite... |
|
|
| Report Abuse |
|
|
djboy
|
  |
| Joined: 16 Mar 2008 |
| Total Posts: 794 |
|
|
| 07 Mar 2015 04:21 PM |
| Even if i did the oppisite i would get the same result since there still checking for the same things (I did try it still, Did the same thing.) |
|
|
| Report Abuse |
|
|
djboy
|
  |
| Joined: 16 Mar 2008 |
| Total Posts: 794 |
|
| |
|
KAAK82
|
  |
| Joined: 06 May 2014 |
| Total Posts: 1166 |
|
|
| 07 Mar 2015 04:37 PM |
game.Players.PlayerAdded:connect(function(Player) Player.CharacterAdded:connect(function(Character) wait(1) Char = game.ReplicatedStorage.Dummy:clone() Char.Parent = game.Workspace Char.Name = Player.Name Player.Character = Char wait(2) if Character:FindFirstChild("Wand") then print("There is a wand") elseif not Character:FindFirstChild("Wand") then print("There is no wand") end if not Player.Backpack:FindFirstChild("LocalScript") then game.ReplicatedStorage.LocalScripts.LocalScript:clone().Parent = Player.Backpack end end) end)
u tried this??? |
|
|
| Report Abuse |
|
|
djboy
|
  |
| Joined: 16 Mar 2008 |
| Total Posts: 794 |
|
|
| 07 Mar 2015 04:42 PM |
| Yes your way made it worse. |
|
|
| Report Abuse |
|
|
yobo89
|
  |
| Joined: 05 Jun 2010 |
| Total Posts: 2341 |
|
|
| 07 Mar 2015 04:46 PM |
| Join my game called Secret WIP, is this what wyou mean buy custom character? |
|
|
| Report Abuse |
|
|
djboy
|
  |
| Joined: 16 Mar 2008 |
| Total Posts: 794 |
|
|
| 07 Mar 2015 04:51 PM |
| No, my custom character is a actual character with a humanoid and everything it just has a extra brick attached to it with it motor 6D onto the torso. |
|
|
| Report Abuse |
|
|
KAAK82
|
  |
| Joined: 06 May 2014 |
| Total Posts: 1166 |
|
|
| 07 Mar 2015 05:40 PM |
well I tried doing this with CharacterAutoLoads = true but it was quiet impossible cos of all the Errors and stuff...
so I just did it without CharacterAutoLoads :P my Test Place is an example of Custom Characters... |
|
|
| Report Abuse |
|
|
djboy
|
  |
| Joined: 16 Mar 2008 |
| Total Posts: 794 |
|
|
| 07 Mar 2015 05:54 PM |
| I turned CharacterAutoLoad off and it still respawns the character :/ |
|
|
| Report Abuse |
|
|
KAAK82
|
  |
| Joined: 06 May 2014 |
| Total Posts: 1166 |
|
|
| 07 Mar 2015 06:16 PM |
o.O I don't think so :/ cos it SHOULD NOT Respawn a Character Automatically with it Off... so I think u either mixed false up with true or there's some hidden script or something that Automatically Spawns a Character for ya :/ |
|
|
| Report Abuse |
|
|
djboy
|
  |
| Joined: 16 Mar 2008 |
| Total Posts: 794 |
|
|
| 07 Mar 2015 06:34 PM |
| I relooked everything, Nothing respawns it :/.. roblox bug? |
|
|
| Report Abuse |
|
|
KAAK82
|
  |
| Joined: 06 May 2014 |
| Total Posts: 1166 |
|
| |
|
djboy
|
  |
| Joined: 16 Mar 2008 |
| Total Posts: 794 |
|
|
| 07 Mar 2015 07:41 PM |
| Like it only respawns the character when i change the character.... |
|
|
| Report Abuse |
|
|
|
| 07 Mar 2015 09:07 PM |
It's the CharacterAdded function. It keeps Creating a new Model for the Character and "Loops" because you're setting a new Character for the Player which is the "Dummy" from the Replicated Storage. |
|
|
| Report Abuse |
|
|
|
| 07 Mar 2015 09:52 PM |
Activated = false
local function CreateCharacter( Player ) if Activated then return end wait(2) local Character = Player.Character if Character:FindFirstChild("Wand") then print("There is a wand") elseif Character:FindFirstChild("Wand") == nil then print("There is no wand") local Char = game.ReplicatedStorage.Dummy:clone() Char.Parent = game.Workspace Char.Name = Player.Name..'2' Activated = true Player.Character = Char local Humanoid = Char:FindFirstChild( 'Humanoid' ) Humanoid.Died:connect(function() Activated = false end) wait(1) if not Player.Backpack:FindFirstChild("LocalScript") then game.ReplicatedStorage.LocalScripts.LocalScript:clone().Parent = Player.Backpack end end end
game.Players.PlayerAdded:connect(function(Player) CreateCharacter( Player ) Player.CharacterAdded:connect(function() CreateCharacter( Player ) end) end) |
|
|
| Report Abuse |
|
|
djboy
|
  |
| Joined: 16 Mar 2008 |
| Total Posts: 794 |
|
|
| 08 Mar 2015 10:50 PM |
| Still respawns, This might be a roblox bug. |
|
|
| Report Abuse |
|
|
KAAK82
|
  |
| Joined: 06 May 2014 |
| Total Posts: 1166 |
|
|
| 09 Mar 2015 07:16 AM |
lol forgot about the Event and the Making of a New Character wen 1 is already made... of course I didn't Read the guy from above Script, it's a lil long so I couldn't be bothered XD
local spawned = false
plr.CharacterAdded:connect(function() if not spawned then --Character Creation/Cloning here spawned = true end end)
try this... I just don't know wen u want to Replace Characters so I just made it 1 Time use... and don't forget to define plr XD am just kinda not into Typing every single Detail... |
|
|
| Report Abuse |
|
|