zeke505
|
  |
| Joined: 26 May 2008 |
| Total Posts: 15765 |
|
|
| 08 Jul 2011 08:20 PM |
It prints "bear mode", but then roblox crashes. No output, just "We're sorry! Roblox has had an unexpected error and needs to quit."
print("bear mode") newchar = game.Lighting.Bear:Clone() newchar:MakeJoints() newchar.Parent = workspace newchar:MakeJoints() pl.Character = newchar wait(30) newchar:Remove() fbody = Instance.new("Model",workspace) ftorso = Instance.new("Part",fbody) ftorso.Transparency = 1 ftorso.CanCollide = false ftorso.Anchored = true ftorso.Name = "Torso" ftorso.Position = Vector3.new(10000,10000,10000) fhum = Instance.new("Humanoid",fbody) fhum.Torso = ftorso pl.Character = fbody |
|
|
| Report Abuse |
|
|
| |
|
zeke505
|
  |
| Joined: 26 May 2008 |
| Total Posts: 15765 |
|
|
| 08 Jul 2011 08:24 PM |
| Also, I'll tried this in Build mode to see the output. I'll try Play really quick. |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2011 08:24 PM |
| Maybe there should only be one MakeJoints? |
|
|
| Report Abuse |
|
|
| |
|
zeke505
|
  |
| Joined: 26 May 2008 |
| Total Posts: 15765 |
|
|
| 08 Jul 2011 08:27 PM |
@stoopid
That wouldn't make roblox crash.
@death kay |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2011 08:29 PM |
LOLOLOLOLOLOLOL
:P
You're using a CharacterAdded event to change the character. Nice work! XD |
|
|
| Report Abuse |
|
|
zeke505
|
  |
| Joined: 26 May 2008 |
| Total Posts: 15765 |
|
|
| 08 Jul 2011 08:31 PM |
@AFF
OH GOD IS THAT WRONG?
Anyway, it stops right before it waits to change the player back. |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2011 08:33 PM |
Every time you change the Character to something else, the CharacterAdded event fires. This means you create an infinite amount of threads in a time of 0 seconds.
That is bad for RBX API. ^_< |
|
|
| Report Abuse |
|
|
zeke505
|
  |
| Joined: 26 May 2008 |
| Total Posts: 15765 |
|
|
| 08 Jul 2011 08:34 PM |
| Okay. How would I go about preventing that? Should I change the way I make the character return (I can't think of any other way D:) |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2011 08:38 PM |
A simple bool value will fix it.
local bearifying = false --Beginning of PlayerAdded function
print("bear mode") if not bearifying then bearifying = true newchar = game.Lighting.Bear:Clone() newchar:MakeJoints() newchar.Parent = workspace newchar:MakeJoints() pl.Character = newchar wait(30) newchar:Remove() fbody = Instance.new("Model",workspace) ftorso = Instance.new("Part",fbody) ftorso.Transparency = 1 ftorso.CanCollide = false ftorso.Anchored = true ftorso.Name = "Torso" ftorso.Position = Vector3.new(10000,10000,10000) fhum = Instance.new("Humanoid",fbody) fhum.Torso = ftorso pl.Character = fbody bearifying = false end |
|
|
| Report Abuse |
|
|
zeke505
|
  |
| Joined: 26 May 2008 |
| Total Posts: 15765 |
|
|
| 08 Jul 2011 08:39 PM |
| Oh, wow. Thanks. You always help me out when I'm in a pickle <3 |
|
|
| Report Abuse |
|
|
Biostream
|
  |
| Joined: 28 Mar 2011 |
| Total Posts: 913 |
|
|
| 08 Jul 2011 08:39 PM |
| Just do game.Players.ChildAdded, not CharacterAdded |
|
|
| Report Abuse |
|
|
zeke505
|
  |
| Joined: 26 May 2008 |
| Total Posts: 15765 |
|
|
| 08 Jul 2011 08:42 PM |
| Gah. It still goes crashy. Also, this is a tool, biostream. ._. |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2011 08:43 PM |
o.o
Post the entire script. Include your CharacterAdded script as well. |
|
|
| Report Abuse |
|
|
Biostream
|
  |
| Joined: 28 Mar 2011 |
| Total Posts: 913 |
|
| |
|
zeke505
|
  |
| Joined: 26 May 2008 |
| Total Posts: 15765 |
|
|
| 08 Jul 2011 08:44 PM |
I don't have one, it's just a tool.
bearifying = false dpsring = false mode = script.Parent.Mode script.Parent.Equipped:connect(function(m) m.KeyDown:connect(function(k) if k:lower() == "r" then if mode.Value == 1 or mode.Value == 2 then mode.Value = mode.Value + 1 print("mode" .. mode.Value) elseif mode.Value == 3 then mode.Value = 1 print("mode" .. mode.Value) end elseif k:lower() == "e" then if mode.Value == 3 or mode.Value == 2 then mode.Value = mode.Value - 1 print("mode" .. mode.Value) elseif mode.Value == 1 then mode.Value = 3 print("mode" .. mode.Value) end end end) m.Button1Down:connect(function() pl = game.Players.LocalPlayer ch = pl.Character if mode.Value == 1 and m.Hit and (ch.Torso.Position - m.Hit.p).magnitude <= 20 and not dpsring then dpsring = true cfr = m.Hit.p + Vector3.new(0,.3,0) print("omgmode1") p = Instance.new("Part", ch) d = Instance.new("Decal", p) d.Texture = "http://www.roblox.com/asset/?id=55663565" d.Face = "Top" d1 = d:Clone() d1.Parent = p d1.Texture = d.Texture d1.Face = "Bottom" p.formFactor = "Custom" p.Size = Vector3.new(5,1,5) p.Transparency = 1 p.CanCollide = false p.Anchored = true p.CFrame = CFrame.new(cfr) wait(3) for i=1, 3, .1 do p.Size = p.Size + Vector3.new(1,0,1) p.CFrame = CFrame.new(cfr + Vector3.new(0,i*2,0)) wait(.1) p.Size = p.Size + Vector3.new(1,0,1) p.CFrame = CFrame.new(cfr + Vector3.new(0,i*2,0)) wait(.1) p.Size = p.Size + Vector3.new(1,0,1) p.CFrame = CFrame.new(cfr + Vector3.new(0,i*2,0)) wait(.1) p.Size = p.Size + Vector3.new(1,0,1) p.CFrame = CFrame.new(cfr + Vector3.new(0,i*2,0)) wait(.1) end p:Remove() dpsring = false elseif mode.Value == 2 then print("bear mode") if not bearifying then bearifying = true newchar = game.Lighting.Bear:Clone() print("clone") newchar:MakeJoints() print("madejoints1") newchar.Parent = workspace print("parented") newchar:MakeJoints() print("madejoints2") pl.Character = newchar print("madechar") wait(30) print("waited") newchar:Remove() fbody = Instance.new("Model",workspace) ftorso = Instance.new("Part",fbody) ftorso.Transparency = 1 ftorso.CanCollide = false ftorso.Anchored = true ftorso.Name = "Torso" ftorso.Position = Vector3.new(10000,10000,10000) fhum = Instance.new("Humanoid",fbody) fhum.Torso = ftorso pl.Character = fbody bearifying = false end end end) end) |
|
|
| Report Abuse |
|
|
|
| 08 Jul 2011 08:46 PM |
| What does the Output print? I can't see the error. |
|
|
| Report Abuse |
|
|
zeke505
|
  |
| Joined: 26 May 2008 |
| Total Posts: 15765 |
|
|
| 08 Jul 2011 08:48 PM |
| It doesn't print any error, but it crashes right after it prints "madechar" |
|
|
| Report Abuse |
|
|
zeke505
|
  |
| Joined: 26 May 2008 |
| Total Posts: 15765 |
|
| |
|
|
| 08 Jul 2011 09:57 PM |
| I don't have an answer, so take a free bump. |
|
|
| Report Abuse |
|
|
zeke505
|
  |
| Joined: 26 May 2008 |
| Total Posts: 15765 |
|
|
| 09 Jul 2011 11:50 AM |
| Bump of holycrapAFFdoesn'tknowtheanswer |
|
|
| Report Abuse |
|
|
Jaccob
|
  |
| Joined: 19 Oct 2008 |
| Total Posts: 986 |
|
| |
|
|
| 09 Jul 2011 12:01 PM |
| Wow this should be a major error in Roblox... |
|
|
| Report Abuse |
|
|
zeke505
|
  |
| Joined: 26 May 2008 |
| Total Posts: 15765 |
|
| |
|