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 |
|
|
| |
|
TwoCoding
|
  |
| Joined: 26 Jul 2012 |
| Total Posts: 423 |
|
|
| 26 Jun 2016 03:34 PM |
Its A ServerScript
TwoCoding, |
|
|
| Report Abuse |
|
|
|
| 26 Jun 2016 03:34 PM |
"local player = game.Players.LocalPlayer"
wat
|
|
|
| Report Abuse |
|
|
TwoCoding
|
  |
| Joined: 26 Jul 2012 |
| Total Posts: 423 |
|
|
| 26 Jun 2016 03:36 PM |
So I can Find The Player
TwoCoding, |
|
|
| Report Abuse |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 26 Jun 2016 03:37 PM |
local player doesn't work in serverscriptts lol
|
|
|
| Report Abuse |
|
|
TwoCoding
|
  |
| Joined: 26 Jul 2012 |
| Total Posts: 423 |
|
|
| 26 Jun 2016 03:38 PM |
object is a parent not a character
TwoCoding, |
|
|
| Report Abuse |
|
|
|
| 26 Jun 2016 03:39 PM |
"object is a parent not a character"
wtf do you mean
|
|
|
| Report Abuse |
|
|
TwoCoding
|
  |
| Joined: 26 Jul 2012 |
| Total Posts: 423 |
|
|
| 26 Jun 2016 03:39 PM |
object is a part*
TwoCoding, |
|
|
| Report Abuse |
|
|
|
| 26 Jun 2016 03:40 PM |
then why are you trying to get the player
|
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 26 Jun 2016 03:42 PM |
i don't understand why you have "if object.Product.Value == true then"
|
|
|
| Report Abuse |
|
|
TwoCoding
|
  |
| Joined: 26 Jul 2012 |
| Total Posts: 423 |
|
|
| 26 Jun 2016 03:43 PM |
Product Is a Bool
TwoCoding, |
|
|
| Report Abuse |
|
|
| |
|
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
|
  |
| 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
|
  |
| Joined: 26 Jul 2012 |
| Total Posts: 423 |
|
|
| 26 Jun 2016 03:45 PM |
Products Parent Is Death Cereal Or Part
TwoCoding, |
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 26 Jun 2016 03:47 PM |
wait, is it a part inside of a tool?
|
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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
|
  |
| Joined: 26 Jul 2012 |
| Total Posts: 423 |
|
|
| 26 Jun 2016 03:50 PM |
Nope Shopping Checkout
TwoCoding, |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|