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: Weird Script Issues...

Previous Thread :: Next Thread 
TwoCoding is not online. TwoCoding
Joined: 26 Jul 2012
Total Posts: 423
26 Jun 2016 03:30 PM
Basically when the part is touched a gui pops up and it is not making

Name The Name Of The Part

Script:

script.Parent.Touched:connect(function(object)

if object.Product.Value == true then

local player = game.Players.LocalPlayer

player.PlayerGui.Buy.Frame.Visible = true

player.PlayerGui.Buy.Frame.Frame.Price.Text = ("$"..object.Price.Value)

player.PlayerGui.Buy.Frame.Frame.Name.Text = (object.Name)

else

warn("Not A Product")

end

end)

ERRORS:

Workspace.Part.Script:11: attempt to index field 'Name' (a string value)

When Touched: Workspace.Part.Hi:11: attempt to index field 'Name' (a string value)

Script Is Called Hi


TwoCoding,
Report Abuse
expoundings is online. expoundings
Joined: 02 Feb 2013
Total Posts: 2359
26 Jun 2016 03:33 PM
lol why a localscript


Report Abuse
TwoCoding is not online. TwoCoding
Joined: 26 Jul 2012
Total Posts: 423
26 Jun 2016 03:34 PM
Its A ServerScript


TwoCoding,
Report Abuse
expoundings is online. expoundings
Joined: 02 Feb 2013
Total Posts: 2359
26 Jun 2016 03:34 PM
"local player = game.Players.LocalPlayer"

wat


Report Abuse
TwoCoding is not online. TwoCoding
Joined: 26 Jul 2012
Total Posts: 423
26 Jun 2016 03:36 PM
So I can Find The Player


TwoCoding,
Report Abuse
expoundings is online. expoundings
Joined: 02 Feb 2013
Total Posts: 2359
26 Jun 2016 03:37 PM
well i found the problem:

player.PlayerGui.Buy.Frame.Frame.Name.Text = (object.Name)

the script is trying to index "Frame.Name" rather than your object called "Name" so name your gui called name something else then it should work


Report Abuse
Exzeption is not online. Exzeption
Joined: 01 Nov 2011
Total Posts: 1312
26 Jun 2016 03:37 PM
do game.Players:GetPlayerFromCharacter(object.Parent) instead of LocalPlayer, game.Players.LocalPlayer only works in localscripts


~The Low Brass Master
Report Abuse
expoundings is online. expoundings
Joined: 02 Feb 2013
Total Posts: 2359
26 Jun 2016 03:37 PM
local player doesn't work in serverscriptts lol


Report Abuse
TwoCoding is not online. TwoCoding
Joined: 26 Jul 2012
Total Posts: 423
26 Jun 2016 03:38 PM
object is a parent not a character


TwoCoding,
Report Abuse
expoundings is online. expoundings
Joined: 02 Feb 2013
Total Posts: 2359
26 Jun 2016 03:39 PM
"object is a parent not a character"

wtf do you mean


Report Abuse
TwoCoding is not online. TwoCoding
Joined: 26 Jul 2012
Total Posts: 423
26 Jun 2016 03:39 PM
object is a part*


TwoCoding,
Report Abuse
expoundings is online. expoundings
Joined: 02 Feb 2013
Total Posts: 2359
26 Jun 2016 03:40 PM
then why are you trying to get the player


Report Abuse
Exzeption is not online. Exzeption
Joined: 01 Nov 2011
Total Posts: 1312
26 Jun 2016 03:41 PM
ya, the character is the model that the part is in


~The Low Brass Master
Report Abuse
expoundings is online. expoundings
Joined: 02 Feb 2013
Total Posts: 2359
26 Jun 2016 03:42 PM
i don't understand why you have "if object.Product.Value == true then"


Report Abuse
TwoCoding is not online. TwoCoding
Joined: 26 Jul 2012
Total Posts: 423
26 Jun 2016 03:43 PM
Product Is a Bool


TwoCoding,
Report Abuse
expoundings is online. expoundings
Joined: 02 Feb 2013
Total Posts: 2359
26 Jun 2016 03:43 PM
what is its parent


Report Abuse
TwoCoding is not online. TwoCoding
Joined: 26 Jul 2012
Total Posts: 423
26 Jun 2016 03:44 PM
Also What Do I Do For Things Like this:

player.PlayerGui.Buy.Frame.Visible = true

cause it used to be player is PLAYER1 Or TwoCoding


TwoCoding,
Report Abuse
Exzeption is not online. Exzeption
Joined: 01 Nov 2011
Total Posts: 1312
26 Jun 2016 03:44 PM
the object argument would be the part that touched the script's parent, so it would be like "Left leg" or whatever part of you character touched it


~The Low Brass Master
Report Abuse
TwoCoding is not online. TwoCoding
Joined: 26 Jul 2012
Total Posts: 423
26 Jun 2016 03:45 PM
Products Parent Is Death Cereal Or Part


TwoCoding,
Report Abuse
TwoCoding is not online. TwoCoding
Joined: 26 Jul 2012
Total Posts: 423
26 Jun 2016 03:46 PM
Okay Heres My Question How Do I Find The Player If Part Touches Part1?


TwoCoding,
Report Abuse
expoundings is online. expoundings
Joined: 02 Feb 2013
Total Posts: 2359
26 Jun 2016 03:47 PM
wait, is it a part inside of a tool?


Report Abuse
Exzeption is not online. Exzeption
Joined: 01 Nov 2011
Total Posts: 1312
26 Jun 2016 03:47 PM
Part1.Touched:connect(function(Part)
local player = game.Players:GetPlayerFromCharacter(Part.Parent)
end)


~The Low Brass Master
Report Abuse
expoundings is online. expoundings
Joined: 02 Feb 2013
Total Posts: 2359
26 Jun 2016 03:49 PM
i'm assuming he's making some kind of coffee machine or something similar to that, in which case the part would be inside a tool

if so, to get the player you can do this

local player = game:GetService'Players':GetPlayerFromCharacter(object.Parent.Parent)


Report Abuse
TwoCoding is not online. TwoCoding
Joined: 26 Jul 2012
Total Posts: 423
26 Jun 2016 03:50 PM
Nope Shopping Checkout


TwoCoding,
Report Abuse
expoundings is online. expoundings
Joined: 02 Feb 2013
Total Posts: 2359
26 Jun 2016 03:51 PM
could you give me permissions to edit the place so i can fix it cause i need to see the if hierarchy of the things


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