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 » Scripters
Home Search
 

Re: what is wrong with this

Previous Thread :: Next Thread 
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
07 Aug 2015 03:48 PM
player = game.Players.LocalPlayer
repeat wait() until player.Character
char = player.Character
Torso = char:WaitForChild("Torso")
statnumbers = player:WaitForChild("statnumbers")
Level = statnumbers:WaitForChild("Level")
script.Parent.MouseButton1Click:connect(function()
if Level.Value >= 10 then
Torso.CFrame = CFrame.new(427.8, 108.9, -355.6)
end
end)

added the waitforchild torso as an attempted fix because it still wouldn't work before. a series of about 12 buttons on a GUI have scripts similar to this and when i join a server to test them, random buttons work if any of them to at all. am i doing something wrong?
Report Abuse
litalela is not online. litalela
Joined: 30 Mar 2010
Total Posts: 6267
07 Aug 2015 03:49 PM
This isn't in a localscript as I see, because there are no locals. Because of this, you cannot do game.Players.LocalPlayer
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
07 Aug 2015 03:51 PM
it is in a localscript..but that means i have to include a "local"?
Report Abuse
litalela is not online. litalela
Joined: 30 Mar 2010
Total Posts: 6267
07 Aug 2015 03:53 PM
Every time you define something in a localscript, you have to do local.

e.g: local player = game.Players.LocalPlayer

as opposed to

player = game.Players.LocalPlayer
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
07 Aug 2015 03:54 PM
ok..i was never aware of that. but sure enough, that worked e.e thanks dude
Report Abuse
litalela is not online. litalela
Joined: 30 Mar 2010
Total Posts: 6267
07 Aug 2015 03:55 PM
np
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
07 Aug 2015 04:32 PM
..now they're all broken again and I don't understand why. I didn't alter it at all since they worked
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
07 Aug 2015 05:06 PM
I printed at every other line in the script and it all printed correctly..
Report Abuse
rayk999 is not online. rayk999
Joined: 18 Feb 2011
Total Posts: 4705
07 Aug 2015 05:09 PM
lita
gtfo
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
07 Aug 2015 05:10 PM
..?
Report Abuse
litalela is not online. litalela
Joined: 30 Mar 2010
Total Posts: 6267
07 Aug 2015 05:29 PM
what'd i do D; cri
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
07 Aug 2015 05:32 PM
i think hes trying to say you're wrong. i only went with what you said because i have nothing else to go on
Report Abuse
litalela is not online. litalela
Joined: 30 Mar 2010
Total Posts: 6267
07 Aug 2015 05:34 PM
no clue

locals is the only thing I see thats incorreect
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
07 Aug 2015 05:35 PM
well this works in another place of mine but not the main game place. and i have no idea what could be breaking it
Report Abuse
litalela is not online. litalela
Joined: 30 Mar 2010
Total Posts: 6267
07 Aug 2015 05:37 PM
any errors?

made sure the positions are all in the same as the place and game place
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
07 Aug 2015 05:39 PM
uh, yeah it's teleporting me in my place "emptyslot" but not my place "hands of death testing server". in emptyslot im trying to fix the script that checks if a player owns the pass or not.

if not game:GetService("MarketplaceService"):PlayerOwnsAsset(game.Players.LocalPlayer,279771338) then
script.Parent.Visible = false
end

it works in another script for another GUI of mine at HoD testing place but not at either place on the GUI im working with now..
Report Abuse
litalela is not online. litalela
Joined: 30 Mar 2010
Total Posts: 6267
07 Aug 2015 05:42 PM
make sure the id's are correct
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
07 Aug 2015 05:42 PM
simple logic is breaking everywhere and i dont understand it T-T
Report Abuse
instawin is not online. instawin
Joined: 04 Jun 2013
Total Posts: 8777
07 Aug 2015 05:42 PM
"Every time you define something in a localscript, you have to do local.

e.g: local player = game.Players.LocalPlayer

as opposed to

player = game.Players.LocalPlayer"

pls no
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
07 Aug 2015 05:43 PM
the ID is correct everywhere
Report Abuse
litalela is not online. litalela
Joined: 30 Mar 2010
Total Posts: 6267
07 Aug 2015 06:07 PM
sorry guys im high
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
07 Aug 2015 06:12 PM
q.q
Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
07 Aug 2015 06:15 PM
local player = game.Players.LocalPlayer
repeat wait() until player.Character
local char = player.Character
local torso = char.Torso
local stats = player:WaitForChild("stats")
local level = stats:WaitForChild("Level")

script.Parent.MouseButton1Click:connect(function()
if level.Value >= 10 then
torso.CFrame = torso.CFrame * CFrame.new(427.8, 108.9, -355.6)
end
end)


"Talk is cheap. Show me the code." - Linus Torvalds
Report Abuse
litalela is not online. litalela
Joined: 30 Mar 2010
Total Posts: 6267
07 Aug 2015 06:16 PM
see timeticks put the locals

my brother
Report Abuse
RecurringNightmare is not online. RecurringNightmare
Joined: 05 Jul 2012
Total Posts: 15336
07 Aug 2015 06:16 PM
nevermind..thanks, everyone, my scripts decided they like me again and it started working..
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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