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: I need help

Previous Thread :: Next Thread 
ZerefSan is not online. ZerefSan
Joined: 14 Jun 2011
Total Posts: 1068
12 Jan 2014 09:54 PM
Script 1:

game.Players.PlayerAdded:connect(function(plr)
if plr then
if plr:IsInGroup(1023176) then
if plr:GetRankInGroup(1023176)~=255 then
local cl=game.Lighting.Claws:Clone()
cl.Clawsmo:Destroy()
cl.Parent=plr.StarterGear
plr:LoadCharacter()
local a=game.Lighting.Claws.Clawsmo:Clone()
a.Parent=plr.Character
a.Name="claw1"
w1=Instance.new("Weld")
w1.Parent=a
w1.Part0=plr.Character:findFirstChild("Left Arm")
w1.Part1=a
w1.C0=CFrame.new(0, -1.5, -.4) * CFrame.Angles(math.pi/2, math.pi, math.pi)
local b=game.Lighting.Claws.Clawsmo:Clone()
b.Parent=plr.Character
b.Name="claw2"
w1=Instance.new("Weld")
w1.Parent=b
w1.Part0=plr.Character:findFirstChild("Right Arm")
w1.Part1=b
w1.C0=CFrame.new(0, -1.5, -.4) * CFrame.Angles(math.pi/2, math.pi, math.pi)
wait()
end
end
end
end)

Workspace.ChildAdded:connect(function(zas)
local plr=game.Players:GetPlayerFromCharacter(zas)
if plr then
if plr:IsInGroup(1023176) then
if plr:GetRankInGroup(1023176)~=255 then
local at=game.Lighting.Claws.Clawsmo:Clone()
at.Parent=plr.Character
at.Name="claw1"
w1=Instance.new("Weld")
w1.Parent=at
w1.Part0=plr.Character:findFirstChild("Left Arm")
w1.Part1=at
w1.C0=CFrame.new(0, -1.5, -.4) * CFrame.Angles(math.pi/2, math.pi, math.pi)
local bt=game.Lighting.Claws.Clawsmo:Clone()
bt.Parent=plr.Character
bt.Name="claw2"
w1=Instance.new("Weld")
w1.Parent=bt
w1.Part0=plr.Character:findFirstChild("Right Arm")
w1.Part1=bt
w1.C0=CFrame.new(0, -1.5, -.4) * CFrame.Angles(math.pi/2, math.pi, math.pi)
end
end
end
end)

Script 2:

tool=script.Parent
plr=game.Players.LocalPlayer
char=plr.Character
cl=char:findFirstChild("claw1")
ca=char:findFirstChild("claw2")

tool.Equipped:connect(function()
cl.Transparency=1
end)


tool.Unequipped:connect(function()
ca.Transparency=0
end)

It returns cl and ca for script 2 as nil. It should not.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
12 Jan 2014 09:55 PM
cl=char:WaitForChild("claw1")
ca=char:WaitForChild("claw2")
Report Abuse
ZerefSan is not online. ZerefSan
Joined: 14 Jun 2011
Total Posts: 1068
12 Jan 2014 09:56 PM
I'll try it out real quick.
Report Abuse
ZerefSan is not online. ZerefSan
Joined: 14 Jun 2011
Total Posts: 1068
12 Jan 2014 09:58 PM
Did not work. :(
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
12 Jan 2014 10:01 PM
With that, try adding this to the top of script 2:

repeat wait(0) until game.Players.LocalPlayer and Game.Players.LocalPlayer.Character
Report Abuse
ZerefSan is not online. ZerefSan
Joined: 14 Jun 2011
Total Posts: 1068
12 Jan 2014 10:11 PM
This works perfectly in test mode. But not in play...
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
12 Jan 2014 10:13 PM
is script 2 in a local script?
Report Abuse
nighttimeninja314 is not online. nighttimeninja314
Joined: 04 Apr 2011
Total Posts: 4001
12 Jan 2014 10:14 PM
if plr:GetRankInGroup(1023176)~=255 then

Should be

if plr:GetRoleInGroup(1023176)~=255 then
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
12 Jan 2014 10:15 PM
No, it should be GetRankInGroup
Report Abuse
ZerefSan is not online. ZerefSan
Joined: 14 Jun 2011
Total Posts: 1068
12 Jan 2014 10:16 PM
Role returns the name of the rank. Cnt, it's not Local. Should it be?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
12 Jan 2014 10:16 PM
Yeah it should, since you are using LocalPlayer
Report Abuse
ZerefSan is not online. ZerefSan
Joined: 14 Jun 2011
Total Posts: 1068
12 Jan 2014 10:16 PM
Oh. I'll try that out.
Report Abuse
ZerefSan is not online. ZerefSan
Joined: 14 Jun 2011
Total Posts: 1068
12 Jan 2014 10:19 PM
Won't work as a LocalScript!
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
12 Jan 2014 10:21 PM
No, the second script must be a local script, not the first
Report Abuse
ZerefSan is not online. ZerefSan
Joined: 14 Jun 2011
Total Posts: 1068
12 Jan 2014 10:22 PM
Would you like a model of this? You will just have to put the claws into Lighting.
Report Abuse
ZerefSan is not online. ZerefSan
Joined: 14 Jun 2011
Total Posts: 1068
12 Jan 2014 10:22 PM
Yeah. I changed the second. First is regular.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
12 Jan 2014 10:23 PM
How does your second script currently look?
Report Abuse
ZerefSan is not online. ZerefSan
Joined: 14 Jun 2011
Total Posts: 1068
12 Jan 2014 10:24 PM
repeat wait(0) until game.Players.LocalPlayer and game.Players.LocalPlayer.Character
tool=script.Parent
plr=game.Players.LocalPlayer
char=plr.Character
cl=char:WaitForChild("claw1")
ca=char:WaitForChild("claw2")

tool.Equipped:connect(function()
cl.Transparency=1
ca.Transparency=1
end)


tool.Unequipped:connect(function()
cl.Transparency=0
ca.Transparency=0
end)
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
12 Jan 2014 10:25 PM
So the arms get added but the tool doesn't make them invisible, correct?
Report Abuse
ZerefSan is not online. ZerefSan
Joined: 14 Jun 2011
Total Posts: 1068
12 Jan 2014 10:26 PM
Arms? What arms?
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
12 Jan 2014 10:26 PM
claws*
Report Abuse
ZerefSan is not online. ZerefSan
Joined: 14 Jun 2011
Total Posts: 1068
12 Jan 2014 10:27 PM
When equipped, the claws become invisible and visible when unequipped. It does not add them. The first one does.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
12 Jan 2014 10:29 PM
That's not what I'm asking.
I'm asking, do the claws get added at all (first script) and if so: when you equip/unequip it, does it not make it invisible/visible
Report Abuse
ZerefSan is not online. ZerefSan
Joined: 14 Jun 2011
Total Posts: 1068
12 Jan 2014 10:31 PM
The claws are added in the first script.It does not make them invisible/visible. That part is broke.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
12 Jan 2014 10:32 PM
Is there an output or it works in solo and not online?
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