|
| 08 Aug 2017 02:16 PM |
How do I make a localscript in StarterPlayer.StarterPlayerScripts reach out to a script in game.Workspace.Test.Script? I'm trying to make the script in the workspace go from it being disabled to enabled, this is the code.
I need it asap to fix my game, it would be very much appreciated!
Localscript code: local function CheckItems() if hasBook and hasCog and hasDoll and hasInk and hasRecord and hasWrench and not activatedItemCollection then activatedItemCollection = true wait(3) workspace.AllItemsCollectedOT:Play() workspace.Test.Script.Disabled = false end end
And the script code: function onTouched(hit) game.Workspace.Thunk:Play() game.Workspace.ScareStand.Transparency = 0 game.Workspace.ScareStand.Script.Disabled = false game.Workspace.StandScare.Transparency = 0 game.Workspace.StandScare.CanCollide = true script.Parent:Destroy() end
script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
| |
|
| |
|
|
| 08 Aug 2017 02:23 PM |
| when is CheckItems being called? |
|
|
| Report Abuse |
|
|
|
| 08 Aug 2017 02:25 PM |
| Whenever a person collects all of the 6 items, although it isn't part of the problem for now, just the LocalScript not enabling the script. |
|
|
| Report Abuse |
|
|
| |
|
|
| 08 Aug 2017 02:28 PM |
| The line you have should work fine. Any output? |
|
|
| Report Abuse |
|
|
|
| 08 Aug 2017 02:33 PM |
What kind of output?
(Sorry, I'm a beginner at scripting only, the scripter I had wouldn't talk anymore and now I'm left alone to do this work independently.) |
|
|
| Report Abuse |
|
|
|
| 08 Aug 2017 02:36 PM |
Go to the View tab in studio and click on Output
Test the game and see if there are any errors |
|
|
| Report Abuse |
|
|
|
| 08 Aug 2017 04:49 PM |
Here was the output
16:44:27.881 - [TESTING] Bendy and the Ink Machine was auto-saved Loaded Loading Cutscene Editor... 16:44:30.425 - Unable to load plugin icon. Image may have an invalid or unknown format. (x2) Badge Awarder Loaded. BadgeID: 902597748 Loading Gravity script Badge Awarder Loaded. BadgeID: 902597748 Ro-Defender Plugin has loaded Ro-Defender has removed a total of 186 viruses and junk items from your games! Cutscene Editor Loaded 16:44:32.299 - Workspace.JustPlaceinworkspace:6: attempt to index field 'Character' (a nil value) 16:44:32.300 - Stack Begin 16:44:32.303 - Script 'Workspace.JustPlaceinworkspace', Line 6 16:44:32.305 - Stack End stopped! 16:44:56.071 - Humanoid is not a valid member of Model 16:44:56.073 - Stack Begin 16:44:56.075 - Script 'Players.BuilderBere.PlayerScripts.View Bobbing', Line 53 16:44:56.076 - Stack End |
|
|
| Report Abuse |
|
|