|
| 07 May 2014 10:05 PM |
| I need a script where it gives out a local script in a part when a player touches the part. |
|
|
| Report Abuse |
|
|
|
| 07 May 2014 10:08 PM |
| Use onTouched function and then clone the script, and then add an 'end' to end the function and then connect the function. |
|
|
| Report Abuse |
|
|
|
| 07 May 2014 11:01 PM |
function touched(Object) if Game.Players:GetPlayerFromCharacter(Object.Parent) and (not bounce) then bounce = true local plr = Game.Players:GetPlayerFromCharacter(Object.Parent) for i, plr in pairs(Game.Players:GetPlayers()) do local ls = Instance.new("LocalScript") ls.Parent = plr.Character end end end bounce = false script.Parent.Touched:connect(touched) |
|
|
| Report Abuse |
|
|
| |
|
|
| 07 May 2014 11:38 PM |
| That won't work pretty sure. |
|
|
| Report Abuse |
|
|
|
| 07 May 2014 11:49 PM |
| I've used this method plenty of times. If you think it won't work, make your own. Geez. The f did you come from? You're not even a good scripting helper. |
|
|
| Report Abuse |
|
|
Yushida
|
  |
| Joined: 19 Oct 2012 |
| Total Posts: 210 |
|
|
| 07 May 2014 11:51 PM |
local debounce = false script.Parent.Touched:connect(function(part) local human = part.Parent:FindFirstChild("Humanoid") if (human ~= nil) and not debounce then debounce = true local player = Game.Players:GetPlayerFromCharacter(part.Parent) if player ~= nil and not player.PlayerGui:FindFirstChild("GuiX") then script.Parent.GuiX:Clone().Parent = player.PlayerGui end wait(2) debounce = false end end) |
|
|
| Report Abuse |
|
|