|
| 28 Dec 2015 12:13 PM |
| ok so a player touches a block on the ground how do i find their name and clone a Gui in them ???? |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 28 Dec 2015 12:18 PM |
Part.Touched:connect(function(Hit) local Player = game.Players:GetPlayerFromCharacter(Hit.Parent) if Hit.Parent then local PlayerGui = Player:WaitForChild("PlayerGui")
-- code -- good luck
end end) |
|
|
| Report Abuse |
|
|
|
| 28 Dec 2015 12:19 PM |
Part = game.Workspace.Part --Part, change this to it's directory GuiSample = game.ReplicatedStorage.Gui --The gui, change this to it's directory Part.Touched:connect(function(Object) --When the object touches, it'll fire if Object.Parent:FindFirstChild("Humanoid") then --We'll check if it is an actual player Gui = GuiSample:Clone() --Clone the GUi Gui.Parent = game.Players:FindFirstChild(Object.Name).PlayerGui --Parent it to the player's PlayerGui end end) |
|
|
| Report Abuse |
|
|
|
| 28 Dec 2015 12:19 PM |
| Forgot to mention Locally this script is Local it is in player |
|
|
| Report Abuse |
|
|
vlekje513
|
  |
| Joined: 28 Dec 2010 |
| Total Posts: 9057 |
|
|
| 28 Dec 2015 12:20 PM |
| Why is this a localscript? |
|
|
| Report Abuse |
|
|
|
| 28 Dec 2015 12:35 PM |
Workspace.Player1.ClickTst.ClickTST 1:37: bad argument #3 to 'Value' (string expected, got nil)
f.Value = game.Players:FindFirstChild(hit.Name)
r.Touched:connect(function(hit) f.Value = game.Players:FindFirstChild(hit.Name) end) |
|
|
| Report Abuse |
|
|
| |
|