MJ501
|
  |
| Joined: 25 Jun 2009 |
| Total Posts: 446 |
|
|
| 08 Jan 2014 10:03 PM |
I have a cutscene pack, and I don't really know why the button isn't activating the cutscene. The pack has a "Track model where you put each frame/coordinate. I also have a localscript which makes it work, and then a button script. Here is the button script:
--name of cutscene cutscene_id = "Cutscene1"
--"infinite" = show whenever button is pressed --"spawn" = show once per spawn --"enter" = show once per gameplay show_rule = "enter"
--if show_rule is "infinite", how long after the end of showing the cutscene can they see it again? debounce_time = 1
----------------------------------------
button = script.Parent ls = button.CutsceneLocalScript
d = false
function showCutscene(player, sync) local n = ls:clone() n.Parent = player.Backpack if not sync then while n.Parent do wait() end end end
function getTags(p) local cs = p:FindFirstChild("Cutscenes") if not cs then cs = Instance.new("IntValue", p) cs.Name = "Cutscenes" end return cs end
function checkTag(p) return getTags(p):FindFirstChild(cutscene_id) end
function setTag(p) local t = Instance.new("IntValue", getTags(p)) t.Name = cutscene_id end
function hasSeenCutsceneEnter(player) return checkTag(player) end function hasSeenCutsceneSpawn(player) return checkTag(player.Character) end
function recSeenCutsceneEnter(player) setTag(player) end function recSeenCutsceneSpawn(player) setTag(player.Character) end
function onTouch(part) --get player local player = game.Players:GetPlayerFromCharacter(part.Parent) if not player then return end --check already watching if player.Backpack:FindFirstChild(ls.Name) then return end --check debounce if d then return end d = true
if show_rule == "enter" then if not hasSeenCutsceneEnter(player) then showCutscene(player) recSeenCutsceneEnter(player) end elseif show_rule == "spawn" then if not hasSeenCutsceneSpawn(player) then showCutscene(player) recSeenCutsceneSpawn(player) end else showCutscene(player) wait(debounce_time) end
d = false end
button.Touched:connect(onTouch)
I put this script in the part that should activate the cutscene. In THIS script is the localscript, and in the localscript is the Track/Frames.
So I need to know how to make the Part activate the Cutscene.
|
|
|
| Report Abuse |
|
MJ501
|
  |
| Joined: 25 Jun 2009 |
| Total Posts: 446 |
|
| |
MJ501
|
  |
| Joined: 25 Jun 2009 |
| Total Posts: 446 |
|
| |
|
| 19 Jan 2014 10:41 PM |
| Idk why cutscene plugin isn't working either. :l |
|
|
| Report Abuse |
|