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: 8 Line script. What's wrong?

Previous Thread :: Next Thread 
Xxcod4glitcherxX is not online. Xxcod4glitcherxX
Joined: 21 Feb 2009
Total Posts: 183
04 Jun 2013 05:08 PM
while true do
    wait(0)
    if (script.Parent.Value.Value == true) then
onHit(function(char)
for i,v in pairs(script:GetChildren()) do v:clone().Parent = char end
end) end)

script.Parent.Seat1.Touched:connect(onHit)


The problem is the ends that I can see. What do I need to do to fix them?
Report Abuse
1Topcop is not online. 1Topcop
Joined: 09 Jun 2009
Total Posts: 6635
04 Jun 2013 05:14 PM
script.Parent.Seat1.ChildAdded:connect(function(Player)
if(Player.Name=="SeatWeld" and Player:IsA("Weld") and Player.Part1)then
Player = game.Players:GetPlayersFromCharacter(Player.Part1.Parent)
if(Player)then
for n,o in pairs(script:GetChildren())do o:clone().Parent=Player.Character
end end end)
Report Abuse
turbodaze is not online. turbodaze
Joined: 17 Dec 2008
Total Posts: 2169
04 Jun 2013 05:20 PM
wait(0) should be wait()
Report Abuse
Xxcod4glitcherxX is not online. Xxcod4glitcherxX
Joined: 21 Feb 2009
Total Posts: 183
04 Jun 2013 05:27 PM
I used that then added in a value and it still wont work :l

script.Parent.Seat1.ChildAdded:connect(function(Player)
if(Player.Name=="SeatWeld" and Player:IsA("Weld") and Player.Part1)and script.Parent.Parent.Lock.Value == true then
Player = game.Players:GetPlayersFromCharacter(Player.Part1.Parent)
if(Player)then
for n,o in pairs(script:GetChildren())do o:clone().Parent=Player.Character
end end end end)
Report Abuse
Xxcod4glitcherxX is not online. Xxcod4glitcherxX
Joined: 21 Feb 2009
Total Posts: 183
04 Jun 2013 06:37 PM
Whats wrong with that script ^
Report Abuse
1Topcop is not online. 1Topcop
Joined: 09 Jun 2009
Total Posts: 6635
04 Jun 2013 07:48 PM
Output?
Report Abuse
Xxcod4glitcherxX is not online. Xxcod4glitcherxX
Joined: 21 Feb 2009
Total Posts: 183
04 Jun 2013 07:52 PM
19:51:56.120 - Seat1 is not a valid member of Seat
19:51:56.121 - Script "Workspace.Unit5054.Seat2.Giver", Line 1
19:51:56.121 - stack end
19:51:56.122 - Humanoid is not a valid member of Script
19:51:56.122 - Script "Workspace.Unit5054.Seat2.Giver.AntiJump", Line 1
19:51:56.123 - stack end
Report Abuse
1Topcop is not online. 1Topcop
Joined: 09 Jun 2009
Total Posts: 6635
04 Jun 2013 10:01 PM
You put the script in the seat, then tried to get Seat1 from the Seat, but Seat1 is not in Seat.
Report Abuse
Xxcod4glitcherxX is not online. Xxcod4glitcherxX
Joined: 21 Feb 2009
Total Posts: 183
04 Jun 2013 11:21 PM
Well I fixed that part so the script looks like this. I am not sure what Part1 is however. I get no output from it.

script.Parent.ChildAdded:connect(function(Player)
if(Player.Name=="SeatWeld" and Player:IsA("Weld") and Player.Part1)and script.Parent.Parent.Lock.Value == true then
Player = game.Players:GetPlayersFromCharacter(Player.Part1.Parent)
if(Player)then
for n,o in pairs(script:GetChildren())do o:clone().Parent=Player.Character
end end end end)
Report Abuse
RobloxWarrior89 is not online. RobloxWarrior89
Joined: 29 Mar 2012
Total Posts: 2388
04 Jun 2013 11:23 PM
bump, just helping out the thread :D.
Report Abuse
Xxcod4glitcherxX is not online. Xxcod4glitcherxX
Joined: 21 Feb 2009
Total Posts: 183
05 Jun 2013 01:38 AM
;D
Report Abuse
zackeryjerrypowers is not online. zackeryjerrypowers
Joined: 01 Aug 2008
Total Posts: 1515
05 Jun 2013 02:53 AM
repeat wait() until script.Parent.Value.Value == true
function onhit(char)
if char.Humanoid then
for i,v in pairs(script:GetChildren()) do
v:Clone().Parent = char
end
end
end

script.Parent.Seat1.Touched:connect(onhit)
Report Abuse
Xxcod4glitcherxX is not online. Xxcod4glitcherxX
Joined: 21 Feb 2009
Total Posts: 183
05 Jun 2013 02:58 AM
Didn't work :l
Report Abuse
1Topcop is not online. 1Topcop
Joined: 09 Jun 2009
Total Posts: 6635
05 Jun 2013 06:21 PM
script.Parent.ChildAdded:connect(function(Player)
if(Player.Name=="SeatWeld" and Player:IsA("Weld") and Player.Part1)and script.Parent.Parent.Lock.Value == true then
Player = game.Players:GetPlayersFromCharacter(Player.Part1.Parent)
if(Player)then
for n,o in pairs(script:GetChildren())do o:clone().Parent=Player.Character
end end end end)
-- The Part1 is a property of Weld, a Weld named SeatWeld is inserted into a seat when a humanoid sits in it.
-- What seems to be the problem with this script?
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