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: Error when a player steps on a brick it teleports them?

Previous Thread :: Next Thread 
babyzander44 is not online. babyzander44
Joined: 14 Aug 2011
Total Posts: 756
05 Nov 2011 10:10 PM
bool = false
target = game.Workspace.End1
script.Parent.Touched:connect(function(hit)
local hum = hit.Parent:findFirstChild("Humanoid")
if hum ~= nil and not bool then
bool = true
local fold = game.Players:findFirstChild(hit.Parent.Name):findFirstChild("PlayerGui")
local holder = fold:findFirstChild("Loader")
local gui = holder.Frame
for i = 1, 0, -0.1 do
gui.BackgroundTransparency = i
wait(.05)
end
local plyr = hit.Parent:findFirstChild("Torso")
local posi = target.Position
local num = tostring("1")
local x1 = getfenv(1)[Posi..Num].x -- 17
local y1 = getfenv(1)[Posi..Num].y
local z1 = getfenv(1)[Posi..Num].z
xp = x1 + 2
zp = z1 + 2
yp = y1 + 2
local c = plyr.CFrame
local x2 = 0
local y2 = y
local z2 = 0
c.CFrame = CFrame.new(Vector3.new(xp,yp,zp), Vector3.new(x2,y2,z2))
wait(2.5)
for v = 0, 1, 0.1 do
gui.BackgroundTransparency = v
wait(.2)
end
bool = false
end
end)

Error: Sat Nov 05 22:59:55 2011 - Workspace.Part.Script:17: attempt to concatenate global 'Posi' (a nil value)

Why can't I put it in a chain?
Report Abuse
babyzander44 is not online. babyzander44
Joined: 14 Aug 2011
Total Posts: 756
05 Nov 2011 10:19 PM
bump
Report Abuse
blocco is not online. blocco
Joined: 14 Aug 2008
Total Posts: 29474
05 Nov 2011 10:22 PM
ermmm

Lua is case sensitive, bro
Report Abuse
dfringloh1 is not online. dfringloh1
Joined: 02 Dec 2009
Total Posts: 236
05 Nov 2011 10:23 PM
Try using a lower case. Use posi instead of Posi
Report Abuse
babyzander44 is not online. babyzander44
Joined: 14 Aug 2011
Total Posts: 756
05 Nov 2011 10:24 PM
@Blocco

I didn't realize what you meant until I looked back at the variables, rofl.

Now it's giving me this:


Sat Nov 05 23:23:49 2011 - Workspace.Part.Script:17: attempt to concatenate local 'posi' (a userdata value)
Report Abuse
blocco is not online. blocco
Joined: 14 Aug 2008
Total Posts: 29474
05 Nov 2011 10:26 PM
I don't understand what you're trying to do....

You want it to index "x, y, z1"?
Report Abuse
babyzander44 is not online. babyzander44
Joined: 14 Aug 2011
Total Posts: 756
05 Nov 2011 10:32 PM
@Blocco

What you're asking makes no sense? I'm trying to retrieve the stack level(position in terms) of the brick the players will be moved to.
Report Abuse
blocco is not online. blocco
Joined: 14 Aug 2008
Total Posts: 29474
05 Nov 2011 10:33 PM
Your code makes little to no sense.
Report Abuse
babyzander44 is not online. babyzander44
Joined: 14 Aug 2011
Total Posts: 756
05 Nov 2011 10:34 PM
@Blocco

If it makes no sense, then why don't you help me with it instead of bickering you pest?
Report Abuse
blocco is not online. blocco
Joined: 14 Aug 2008
Total Posts: 29474
05 Nov 2011 10:35 PM
I can't figure out what you want to do
Report Abuse
babyzander44 is not online. babyzander44
Joined: 14 Aug 2011
Total Posts: 756
05 Nov 2011 10:36 PM
@Blocco

It's right in the title.. "player steps on a brick it teleports them?"
Report Abuse
blocco is not online. blocco
Joined: 14 Aug 2008
Total Posts: 29474
05 Nov 2011 10:37 PM
You're doing things incorrectly:

"local c = plyr.CFrame
local x2 = 0
local y2 = y
local z2 = 0
c.CFrame = CFrame.new(Vector3.new(xp,yp,zp), Vector3.new(x2,y2,z2))"

the CFrame object does not have a CFrame property.
Report Abuse
babyzander44 is not online. babyzander44
Joined: 14 Aug 2011
Total Posts: 756
05 Nov 2011 10:41 PM
@Blocco

But that doesn't have anything to do with the error I'm getting currently. o_o
Report Abuse
blocco is not online. blocco
Joined: 14 Aug 2008
Total Posts: 29474
05 Nov 2011 10:42 PM
I know, but as a Preprocessing Replying Intergalactic Cyborg of Kindness (PRICK), it is my duty to tell you every and any error in your code.
Report Abuse
babyzander44 is not online. babyzander44
Joined: 14 Aug 2011
Total Posts: 756
05 Nov 2011 10:44 PM
@Blocco

ROFL.
Report Abuse
babyzander44 is not online. babyzander44
Joined: 14 Aug 2011
Total Posts: 756
05 Nov 2011 10:47 PM
I'm about to go to Scripters. D:
Report Abuse
blocco is not online. blocco
Joined: 14 Aug 2008
Total Posts: 29474
05 Nov 2011 10:49 PM
wow

you joined exactly three years after I did. What are the odds
Report Abuse
babyzander44 is not online. babyzander44
Joined: 14 Aug 2011
Total Posts: 756
05 Nov 2011 10:49 PM
@blocco

very slim odds i guess
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