|
| 13 Dec 2014 05:00 PM |
local model = script.Parent -- Ignore this, doesn't need fixing.
local function steppedOn(part) local parent = part.Parent if game.Players:GetPlayerFromCharacter(parent) then game.Workspace.Lift.Mover:Destroy() -- Ignore this, doesn't need fixing. local sound = Instance.new("Sound",parent) sound.SoundId = "http://www.roblox.com/asset/?id=189701469" sound.Volume = 1 sound.TimePosition = 54 sound:Play() end end
model.Touched:connect(steppedOn)
Ignore the code where I have put "-- Ignore this, doesn't need fixing."
And about the sound, what I'm trying to do is to make it so that the LocalPlayer can only hear it, and not a global sound. |
|
|
| Report Abuse |
|
|
|
| 13 Dec 2014 05:02 PM |
local model = script.Parent -- Ignore this, doesn't need fixing.
local function steppedOn(part) local parent = part.Parent local player = game.Players:GetPlayerFromCharacter(parent) if player then game.Workspace.Lift.Mover:Destroy() -- Ignore this, doesn't need fixing. local sound = Instance.new("Sound",player) sound.SoundId = "rbxassetid://189701469" sound.Volume = 1 sound.TimePosition = 54 sound:Play() end end
model.Touched:connect(steppedOn)
Should work |
|
|
| Report Abuse |
|
|
|
| 13 Dec 2014 05:05 PM |
The sound plays, I'm just trying to make it so the LocalPlayer hears the sound, not everyone in the server..
#DurstIlluminati (R$: R$37,776) (RAP: 572,058) |
|
|
| Report Abuse |
|
|
|
| 13 Dec 2014 05:11 PM |
b
#DurstIlluminati (R$: R$37,945) (RAP: 572,058) |
|
|
| Report Abuse |
|
|
parkiet3
|
  |
| Joined: 16 Jul 2011 |
| Total Posts: 832 |
|
|
| 13 Dec 2014 05:13 PM |
| Parent it to the currentcamera |
|
|
| Report Abuse |
|
|
|
| 13 Dec 2014 05:14 PM |
Thanks.
#DurstIlluminati (R$: R$38,014) (RAP: 572,058) |
|
|
| Report Abuse |
|
|
parkiet3
|
  |
| Joined: 16 Jul 2011 |
| Total Posts: 832 |
|
|
| 13 Dec 2014 05:18 PM |
local model = script.Parent -- Ignore this, doesn't need fixing.
local function steppedOn(part) local parent = part.Parent
if game.Players:GetPlayerFromCharacter(parent) then game.Workspace.Lift.Mover:Destroy() -- Ignore this, doesn't need fixing. script.LocalScript:Clone().Parent=parent end end
model.Touched:connect(steppedOn)
in a localscript inside that script do:
local sound = Instance.new("Sound",game.Workspace.CurrentCamera) sound.SoundId = "http://www.roblox.com/asset/?id=189701469" sound.Volume = 1 sound.TimePosition = 54 sound:Play() |
|
|
| Report Abuse |
|
|
|
| 13 Dec 2014 05:19 PM |
Helps, as I was wondering how the CurrentCamera works, or where it was. :\
#DurstIlluminati (R$: R$38,207) (RAP: 572,058) |
|
|
| Report Abuse |
|
|
parkiet3
|
  |
| Joined: 16 Jul 2011 |
| Total Posts: 832 |
|
|
| 13 Dec 2014 05:20 PM |
| Haha, currentcamera can only be accessed from localscripts |
|
|
| Report Abuse |
|
|
|
| 13 Dec 2014 05:34 PM |
Sound doesn't play.. Odd..
#DurstIlluminati (R$: R$38,342) (RAP: 572,058) |
|
|
| Report Abuse |
|
|
parkiet3
|
  |
| Joined: 16 Jul 2011 |
| Total Posts: 832 |
|
| |
|
|
| 13 Dec 2014 05:36 PM |
That script you gave me, doesn't play the sound. It's got the sound there, but hasn't been added to the CurrentCamera..
#DurstIlluminati (R$: R$38,349) (RAP: 572,058) |
|
|
| Report Abuse |
|
|
shred1894
|
  |
| Joined: 30 Aug 2009 |
| Total Posts: 6515 |
|
|
| 13 Dec 2014 05:45 PM |
| Camera is having issues or something, parent the sound to PlayerGui. |
|
|
| Report Abuse |
|
|
|
| 13 Dec 2014 05:47 PM |
Explain "script.LocalScript:Clone().Parent=parent" for me?
#DurstIlluminati (R$: R$38,846) (RAP: 572,058) |
|
|
| Report Abuse |
|
|
shred1894
|
  |
| Joined: 30 Aug 2009 |
| Total Posts: 6515 |
|
|
| 13 Dec 2014 05:48 PM |
local model = script.Parent -- Ignore this, doesn't need fixing.
local function steppedOn(part) local parent = part.Parent
if game.Players:GetPlayerFromCharacter(parent) then game.Workspace.Lift.Mover:Destroy() -- Ignore this, doesn't need fixing. script.LocalScript:Clone().Parent=parent end end
model.Touched:connect(steppedOn)
in a localscript inside that script do:
local sound = Instance.new("Sound",game.Players.LocalPlayer.PlayerGui) sound.SoundId = "http://www.roblox.com/asset/?id=189701469" sound.Volume = 1 sound.TimePosition = 54 sound:Play() |
|
|
| Report Abuse |
|
|
|
| 13 Dec 2014 05:49 PM |
dood, explain "script.LocalScript:Clone().Parent=parent"
#DurstIlluminati (R$: R$38,915) (RAP: 572,058) |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 13 Dec 2014 05:49 PM |
| He clones something inside the script called "LocalScript", which returns the clone and sets the Parent property to whatever "parent" equals. |
|
|
| Report Abuse |
|
|
parkiet3
|
  |
| Joined: 16 Jul 2011 |
| Total Posts: 832 |
|
|
| 13 Dec 2014 05:50 PM |
Slice it in pieces local myscript = script.localscript:Clone -- clone the localscript myscript.Parent = parent -- this is the player, so i cloned a script to the player |
|
|
| Report Abuse |
|
|
|
| 13 Dec 2014 05:50 PM |
Oh, that helps. Thanks! :D
#DurstIlluminati (R$: R$38,950) (RAP: 572,058) |
|
|
| Report Abuse |
|
|
SLY3
|
  |
| Joined: 10 Jul 2008 |
| Total Posts: 1700 |
|
|
| 13 Dec 2014 05:53 PM |
Yes, pretty much all you have to do to play the sound locally, is put a LocalScript in StarterGui, then a sound inside that script, then this as the code:
-- wait(5) -- to avoid any glitches script.Sound:Play() -- |
|
|
| Report Abuse |
|
|
|
| 13 Dec 2014 05:55 PM |
A'ight, I got it to work. Thanks mate.
#DurstIlluminati (R$: R$38,957) (RAP: 572,058) |
|
|
| Report Abuse |
|
|