|
| 17 Oct 2017 04:01 PM |
| I've made a code that makes it so when touched your head transparency goes to 1 (Since I'm a ####### I'm trying to keep it easy.) and well it works all fine in studio, but breaks and doesn't work in-game...could anyone help ? ----------------------------------------CODE---------------------------------------------- local Hider = script.Parent local function On(part) local Parent = part.Parent if game.Players:GetPlayerFromCharacter(Parent)then Parent.Head.Transparency = 1 wait(.1) Parent.Head.Transparency = 1 end end Hider.Touched:connect(On) |
|
|
| Report Abuse |
|
|
|
| 17 Oct 2017 04:03 PM |
local Hider = script.Parent
local function On(part) local Parent = part.Parent if game.Players:GetPlayerFromCharacter(Parent)then Parent.Head.Transparency = 1 wait(.1) Parent.Head.Transparency = 1 end end
Hider.Touched:connect(On)
--(Better view of the code.) |
|
|
| Report Abuse |
|
|
|
| 17 Oct 2017 04:03 PM |
| Put it in a local script and try it again |
|
|
| Report Abuse |
|
|
| |
|
|
| 17 Oct 2017 04:07 PM |
| Try and put the local script in starter character and check output errors when trying different stuff |
|
|
| Report Abuse |
|
|
|
| 17 Oct 2017 04:11 PM |
| Wouldn't that remove the "On-touched" function ? |
|
|
| Report Abuse |
|
|
|
| 17 Oct 2017 04:15 PM |
| You can do game.Workspace.hider |
|
|
| Report Abuse |
|
|
LaeMVP
|
  |
| Joined: 24 Jun 2013 |
| Total Posts: 4416 |
|
|
| 17 Oct 2017 04:17 PM |
local function touched(hit) local char = hit:FindFirstAncestorOfClass("Model") local hum = char and char:FindFirstChild("Humanoid") if hum and hum.Health > 0 then local plr = game.Players:GetPlayerFromCharacter(char) if plr then char.Head.Transparency = 1 end end end
script.Parent.Touched:Connect(touched) |
|
|
| Report Abuse |
|
|
| |
|