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: Local script in starterpack problem?

Previous Thread :: Next Thread 
msgboards is not online. msgboards
Joined: 01 Nov 2013
Total Posts: 228
15 Dec 2013 04:24 PM
I have a local script in the starterpack, and it is only working the first time you join the server, and if you reset or leave and come back it doesn't work anymore. How can I fix this?
Report Abuse
FreeScriptMaker is not online. FreeScriptMaker
Joined: 29 Nov 2013
Total Posts: 2275
15 Dec 2013 04:26 PM
What is the script?
Report Abuse
msgboards is not online. msgboards
Joined: 01 Nov 2013
Total Posts: 228
15 Dec 2013 04:27 PM
it's a bit long

run = game:GetService("RunService")
plr = script.Parent.Parent
torso = script.Parent.Parent.Character.Torso
RightShoulder = torso["Right Shoulder"]
LeftShoulder = torso["Left Shoulder"]
humanoid = script.Parent.Parent.Character.Humanoid
bf = Instance.new("BodyForce", humanoid.Parent.Torso)
humanoid.Jumping:connect(function(wasJump)
if (wasJump) then
humanoid.WalkSpeed = 40
bf.force = Vector3.new(0, 50000, 0)
for i = 1, 1 do
RightShoulder.C0 = RightShoulder.C0 *CFrame.Angles(-1, 0, 0)
run.Stepped:wait(0.025)
end
for i = 1, 1 do
LeftShoulder.C0 = LeftShoulder.C0 *CFrame.Angles(-1, 0, 0)
run.Stepped:wait(0.025)
end
else
bf.force = Vector3.new(0, 0, 0)
wait(0.5)
humanoid.WalkSpeed = 16
for i = 1, 1 do
RightShoulder.C0 = RightShoulder.C0 *CFrame.Angles(1, 0, 0)
run.Stepped:wait(0.025)
end
for i = 1, 1 do
LeftShoulder.C0 = LeftShoulder.C0 *CFrame.Angles(1, 0, 0)
run.Stepped:wait(0.025)
end
script.Disabled = true
wait()
script.Disabled = false

end
end)
Report Abuse
FreeScriptMaker is not online. FreeScriptMaker
Joined: 29 Nov 2013
Total Posts: 2275
15 Dec 2013 04:29 PM
put the localscript in this script

script.Parent = game.ServerScriptService
for i,v in pairs(script:GetChildren()) do
if v:IsA("LocalScript") then
v.Disabled = true
end
end

game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(char)
local plrGui = plr:WaitForChild("PlayerGui")
for i,v in pairs(script:GetChildren()) do
if v:IsA("LocalScript") then
v:Clone().Parent=plrGui
end
end
end)
end)
Report Abuse
msgboards is not online. msgboards
Joined: 01 Nov 2013
Total Posts: 228
15 Dec 2013 04:32 PM
error

Something unexpectedly tried to set the parent of PlayerJump to ServerScriptService while trying to set the parent of PlayerJump. Current parent is Backpack.
Report Abuse
FreeScriptMaker is not online. FreeScriptMaker
Joined: 29 Nov 2013
Total Posts: 2275
15 Dec 2013 04:34 PM
No make a new script with this code then put that localscript inside this script:

wait()
script.Parent = game.ServerScriptService
for i,v in pairs(script:GetChildren()) do
if v:IsA("LocalScript") then
v.Disabled = true
end
end

game.Players.PlayerAdded:connect(function(plr)
plr.CharacterAdded:connect(function(char)
local plrGui = plr:WaitForChild("PlayerGui")
for i,v in pairs(script:GetChildren()) do
if v:IsA("LocalScript") then
local lscript = v:Clone()
lscript.Parent = plrGui
lscript.Disabled = false
end
end
end)
end)
Report Abuse
msgboards is not online. msgboards
Joined: 01 Nov 2013
Total Posts: 228
15 Dec 2013 04:35 PM
thats what i did
Report Abuse
msgboards is not online. msgboards
Joined: 01 Nov 2013
Total Posts: 228
15 Dec 2013 04:45 PM
?
Report Abuse
msgboards is not online. msgboards
Joined: 01 Nov 2013
Total Posts: 228
15 Dec 2013 05:19 PM
?(2)
Report Abuse
msgboards is not online. msgboards
Joined: 01 Nov 2013
Total Posts: 228
15 Dec 2013 05:28 PM
?(3)
Report Abuse
msgboards is not online. msgboards
Joined: 01 Nov 2013
Total Posts: 228
15 Dec 2013 05:30 PM
fixed it
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