generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Strange Problem with Script

Previous Thread :: Next Thread 
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
08 Aug 2013 05:21 PM
This works perfectly in Studio, but not Play mode. It worked before, but then I added this:

wait()
ls:SetDesiredAngle(math.rad(-90))
lh:SetDesiredAngle(0)
rh:SetDesiredAngle(0)
rs:SetDesiredAngle(math.rad(90))
rs.C0 = CFrame.new(0.6,0.4,rs.C0.Z)*CFrame.Angles(0,math.rad(105),0)
ls.C0 = CFrame.new(-0.2, 0.6, -0.5)*CFrame.Angles(0,math.rad(-100),0)

and it broke in Play mode, although it's fine in Studio. No Output, what's wrong?

Btw, this isn't the whole script, and you probably think I forgot my ends, which are at the end of the script. This is the only part of the script you will most likely need.


s = script.Parent
ammo = script.Parent.AmmoGui:Clone()
player = game.Players.LocalPlayer
character = player.Character
rs = character.Torso["Right Shoulder"]
ls = character.Torso["Left Shoulder"]
rh = character.Torso["Right Hip"]
lh = character.Torso["Left Hip"]
reload = false
currentcamera = Workspace.CurrentCamera

s.Equipped:connect(function(mouse)
for i, v in ipairs(s.Handle:GetChildren()) do if v:IsA("Weld") then v:Destroy() end end
for i, v in ipairs(s.Clip1:GetChildren()) do if v:IsA("Weld") then v:Destroy() end end
for i, v in ipairs(character.Torso:GetChildren()) do if v:IsA("Motor6D") then v.MaxVelocity = 0.3 end end
if character:FindFirstChild("Animate") then
character.Animate.Disabled = true
end
function weld(part0,part1,c0)
local weld = Instance.new("Weld",part0)
for n,o in pairs({C0=c0,Part0=part0,Part1=part1})do
weld[n] = o
end
return weld end

h = s.Handle
weld(h,s.BackSight1,CFrame.new(0.06,0.47,-0.7))
weld(h,s.BackSight2,CFrame.new(-0.06,0.47,-0.7))
weld(h,s.BackSightDecoration1,CFrame.new(0.06, 0.54, -0.7))
weld(h,s.BackSightDecoration2,CFrame.new(-0.06, 0.54, -0.7))
weld(h,s.BarrelHole,CFrame.new(0, 0.3, 1.53)*CFrame.Angles(math.rad(90),0,0))
weld(h,s.Body,CFrame.new(0,0.3,0.37)*CFrame.Angles(math.rad(90),0,0))
clip = weld(h,s.Clip1,CFrame.new(0.33,0.3,0.32)) -- Clip variable
weld(s.Clip1,s.Clip2,CFrame.new(0.154,0,0.008)*CFrame.Angles(0,math.rad(-11),0))
weld(s.Clip1,s.Clip3,CFrame.new(0.379,0,0.064)*CFrame.Angles(0,math.rad(-15),0))
weld(h,s.ClipHold,CFrame.new(0.27,0.3,0.32))
weld(h,s.ClipHole,CFrame.new(0.3,0.3,0.32))
weld(h,s.FakeHandle,CFrame.new(0,0,0)*CFrame.Angles(math.rad(20),0,0))
weld(h,s.FrontSight,CFrame.new(0,0.49,1.55))
weld(h,s.HandleDecoration1,CFrame.new(0,-0.188,-0.068)*CFrame.Angles(math.rad(20),0,0))
weld(h,s.HandleDecoration2,CFrame.new(0, -0.094, -0.034)*CFrame.Angles(math.rad(20),0,0))
weld(h,s.HandleDecoration3,CFrame.new(0,0,0)*CFrame.Angles(math.rad(20),0,0))
weld(h,s.Light,CFrame.new(0,0.08,1.51)*CFrame.Angles(math.rad(90),0,0))
weld(h,s.Lighthold,CFrame.new(0,0.09,1.45))
weld(h,s.Stock1,CFrame.new(0,0.31,-1.24))
weld(h,s.Stock2,CFrame.new(0,0.14,-1.44))
weld(h,s.StockHold1,CFrame.new(0.19,0.31,-0.93))
weld(h,s.StockHold2,CFrame.new(-0.19,0.31,-0.93))
weld(h,s.StockHold3,CFrame.new(0,0.31,-1.04))
weld(h,s.StockHold4,CFrame.new(-0.149, 0.31, -0.754)*CFrame.Angles(0,math.rad(39),0))
weld(h,s.StockHold5,CFrame.new(0.153, 0.31, -0.758)*CFrame.Angles(0,math.rad(-39),0))
weld(h,s.Trigger,CFrame.new(0,0.11,0.258)*CFrame.Angles(math.rad(-9),0,0))
weld(h,s.Triggercover,CFrame.new(0,0.1,0.4))
weld(h,s.TriggercoverBottom,CFrame.new(0,0.01,0.27))
ammo.Parent = game.Players.LocalPlayer.PlayerGui
wait()
ls:SetDesiredAngle(math.rad(-90))
lh:SetDesiredAngle(0)
rh:SetDesiredAngle(0)
rs:SetDesiredAngle(math.rad(90))
rs.C0 = CFrame.new(0.6,0.4,rs.C0.Z)*CFrame.Angles(0,math.rad(105),0)
ls.C0 = CFrame.new(-0.2, 0.6, -0.5)*CFrame.Angles(0,math.rad(-100),0)
mouse.Icon = "rbxasset://textures\\GunCursor.png"
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
08 Aug 2013 05:32 PM
Either someone is about to reply because of the 8 views, or nobody knows.
Report Abuse
BalisticMissile is not online. BalisticMissile
Joined: 05 Mar 2009
Total Posts: 282
08 Aug 2013 05:54 PM
Is it a local script?
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
09 Aug 2013 07:34 AM
Yes, it's a LocalScript.
Report Abuse
expressmyself is not online. expressmyself
Joined: 19 Apr 2011
Total Posts: 1768
09 Aug 2013 07:44 AM
Y U NO START SERVER?
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
09 Aug 2013 07:45 AM
I don't start server, I Play mode.
Report Abuse
expressmyself is not online. expressmyself
Joined: 19 Apr 2011
Total Posts: 1768
09 Aug 2013 08:00 AM
So Remote Error Monitoring didn't say anything?
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
09 Aug 2013 08:17 AM
Remote Monitoring doesn't work on LocalScripts. And no, C&Ping the RME code into a LocalScript does not work.
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
09 Aug 2013 08:18 AM
Use Start Server and Start Player, and give us the output (if any)
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
09 Aug 2013 08:21 AM
Do I do Tools > Test > Start Server > Tools > Test > Solo to do it?
Report Abuse
Notunknown99 is not online. Notunknown99
Joined: 05 Sep 2008
Total Posts: 25360
09 Aug 2013 08:23 AM
Start Server then Start Player (And maybe Start Player again if you need more players on the server)
Report Abuse
expressmyself is not online. expressmyself
Joined: 19 Apr 2011
Total Posts: 1768
09 Aug 2013 08:24 AM
do start server then tools start player.
Report Abuse
evolvedpikachu is not online. evolvedpikachu
Joined: 18 Aug 2010
Total Posts: 10696
09 Aug 2013 08:25 AM
Works fine now, thanks.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image