generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Cutscene Button

Previous Thread :: Next Thread 
MJ501 is not online. 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 is not online. MJ501
Joined: 25 Jun 2009
Total Posts: 446
08 Jan 2014 10:24 PM
Bumpppp
Report Abuse
MJ501 is not online. MJ501
Joined: 25 Jun 2009
Total Posts: 446
08 Jan 2014 10:39 PM
bump....?
Report Abuse
EGLBasicRank is not online. EGLBasicRank
Joined: 21 Mar 2010
Total Posts: 76
19 Jan 2014 10:41 PM
Idk why cutscene plugin isn't working either. :l
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image