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: Why will this script not work? >_>

Previous Thread :: Next Thread 
Alex645ca is online. Alex645ca
Joined: 02 Feb 2009
Total Posts: 2531
08 Aug 2011 01:59 PM
button = script.Parent
wait()
corpost = workspace.RegenStuff.Spawns[button.Name]
button.BrickColor = corpost.BrickColor


function ontouch(hit)
if hit == nil then return end
if hit.Parent == nil then return end
local find = hit.Parent:findFirstChild("Humanoid")
if find ~= nil then
local playerfind = game.Players:GetPlayerFromCharacter(hit.Parent)
if playerfind ~= nil then
if playerfind.TeamColor == button.BrickColor then
hit.Parent.Torso.CFrame = corpost.CFrame + CFrame.new(0, 2.5, 0)



end
end
end
end

button.Touched:connect(ontouch)

I checked and it has no errors (on output, anyhow)... But in my place it isn't working.
Report Abuse
Alex645ca is online. Alex645ca
Joined: 02 Feb 2009
Total Posts: 2531
08 Aug 2011 02:12 PM
Bump -_-
Report Abuse
Alex645ca is online. Alex645ca
Joined: 02 Feb 2009
Total Posts: 2531
08 Aug 2011 02:18 PM
Bump again... >_<
Report Abuse
Alex645ca is online. Alex645ca
Joined: 02 Feb 2009
Total Posts: 2531
09 Aug 2011 09:45 AM
Sorry about bumping a 1/2 day old thread, but I had to go somewhere irl yesterday. it took 5 and a half hours, and I still got no replies... >_>
Report Abuse
dirk29 is not online. dirk29
Joined: 26 May 2010
Total Posts: 1142
09 Aug 2011 10:05 AM
For Every function or if, you need 1 end. As i can see there are 4 if's and 1 function. So you need 5 ends
Report Abuse
dirk29 is not online. dirk29
Joined: 26 May 2010
Total Posts: 1142
09 Aug 2011 10:07 AM
Theres 5 if's and 1 function, so 6 end's
Report Abuse
bikerking300 is not online. bikerking300
Joined: 31 Mar 2010
Total Posts: 1034
09 Aug 2011 10:08 AM
button = script.Parent
wait()
corpost = workspace.RegenStuff.Spawns[button.Name]
button.BrickColor = corpost.BrickColor


button.Touched:connect(function(hit)
if hit == nil then return end
if hit.Parent == nil then return end
local find = hit.Parent:findFirstChild("Humanoid")
if find ~= nil then
local playerfind = game.Players:GetPlayerFromCharacter(hit.Parent)
if playerfind ~= nil then
if playerfind.TeamColor == button.BrickColor then
hit.Parent.Torso.CFrame = corpost.CFrame + CFrame.new(0, 2.5, 0)
end end end end end end)
Report Abuse
Alex645ca is online. Alex645ca
Joined: 02 Feb 2009
Total Posts: 2531
09 Aug 2011 10:14 AM
@Dirk

Not helpful at all.

Read the script more carefully and you'll notice that if I do that the script will break. >_>
Report Abuse
Alex645ca is online. Alex645ca
Joined: 02 Feb 2009
Total Posts: 2531
09 Aug 2011 10:15 AM
@biker

Same thing. The first 2 ifs are checking for nothing that is nil, and they have ends on those lines. Again, you're actually breaking the script by doing that.
Report Abuse
Alex645ca is online. Alex645ca
Joined: 02 Feb 2009
Total Posts: 2531
09 Aug 2011 10:39 AM
Bump. :/
Report Abuse
EnzoDaVinci is not online. EnzoDaVinci
Joined: 14 Apr 2011
Total Posts: 3730
09 Aug 2011 10:40 AM
button = script.Parent
wait()
corpost = Workspace.RegenStuff.Spawns[button.Name]
button.BrickColor = corpost.BrickColor


function ontouch(hit)
if hit == nil then return end
if hit.Parent == nil then return end
local find = hit.Parent:findFirstChild("Humanoid")
if find ~= nil then
local playerfind = game.Players:GetPlayerFromCharacter(hit.Parent)
if playerfind ~= nil then
if playerfind.TeamColor == button.BrickColor then
hit.Parent.Torso.CFrame = corpost.CFrame + CFrame.new(0, 2.5, 0)



end
end
end
end

button.Touched:connect(ontouch)
Report Abuse
Alex645ca is online. Alex645ca
Joined: 02 Feb 2009
Total Posts: 2531
09 Aug 2011 10:43 AM
@Enzo

That's the same script >_>...
Report Abuse
VortexSecurityHub is not online. VortexSecurityHub
Joined: 03 Aug 2011
Total Posts: 37
09 Aug 2011 10:47 AM
hit.Parent.Torso.CFrame = corpost.CFrame + CFrame.new(0, 2.5, 0)

needs to be

hit.Parent.Torso.CFrame = corpost.CFrame * CFrame.new(0, 2.5, 0)

For some reason which I can't work out, you need to multiply CFrame values to get them to add. Probably due to the fact they have like, 12 values rather than 3, but meh.
Report Abuse
Alex645ca is online. Alex645ca
Joined: 02 Feb 2009
Total Posts: 2531
09 Aug 2011 10:51 AM
@Vortex

I know, why must CFrame rotations use 9 values rather than 3 (which CFrame.Angles does :P), I have no idea whatsoever... xD
Report Abuse
VortexSecurityHub is not online. VortexSecurityHub
Joined: 03 Aug 2011
Total Posts: 37
09 Aug 2011 10:57 AM
Neither do I, but I know the first 3 are position and the second 3 are angle and tilting. No idea what the third set of 3 is though :o
Report Abuse
dirk29 is not online. dirk29
Joined: 26 May 2010
Total Posts: 1142
14 Aug 2011 10:14 AM
Sorry If I Didnt Help, Im Still A Sort Of Begining Scripter. So Thats What I Thought.
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