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 |
|
|
| |
|
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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 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
|
  |
| Joined: 01 Nov 2013 |
| Total Posts: 228 |
|
| |
|
msgboards
|
  |
| Joined: 01 Nov 2013 |
| Total Posts: 228 |
|
| |
|
msgboards
|
  |
| Joined: 01 Nov 2013 |
| Total Posts: 228 |
|
| |
|
msgboards
|
  |
| Joined: 01 Nov 2013 |
| Total Posts: 228 |
|
| |
|
msgboards
|
  |
| Joined: 01 Nov 2013 |
| Total Posts: 228 |
|
| |
|