BaconSoap
|
  |
| Joined: 12 Sep 2010 |
| Total Posts: 1882 |
|
|
| 08 Jun 2014 11:32 AM |
local enabled = true
if enabled == true then script.Parent.BrickColor = BrickColor.new("Bright green") elseif enabled == false then script.Parent.BrickColor = BrickColor.new("Bright red") end
script.Parent.Touched:connect(function(hit) if hit.Parent and GetPlayerFromCharacter(hit.Parent) and enabled == true then local dogehat = Instance.new("Hat") local dogehathandle = Instance.new("Part") local dogehatmesh = Instance.new("SpecialMesh") dogehatmesh.Scale = Vector3.new(2,2,2) dogehatmesh.MeshId = "http://www.roblox.com/asset/?id=151778863" dogehatmesh.TextureId = "http://www.roblox.com/asset/?id=151778895" dogehathandle.Name = "Handle" dogehathandle.Anchored = false dogehathandle.Parent = dogehat dogehat.Parent = hit.Parent wait(2) end end)
They're just not receiving the hat on touch. |
|
|
| Report Abuse |
|
|
|
| 08 Jun 2014 11:34 AM |
This line:
if hit.Parent and GetPlayerFromCharacter(hit.Parent) and enabled == true then
Should be like this:
if hit.Parent and game.Players:GetPlayerFromCharacter(hit.Parent) and enabled == true then |
|
|
| Report Abuse |
|
|
BaconSoap
|
  |
| Joined: 12 Sep 2010 |
| Total Posts: 1882 |
|
|
| 08 Jun 2014 11:41 AM |
Thanks!
I wasn't all that familiar with GetPlayerFromCharacter method. |
|
|
| Report Abuse |
|
|