| |
|
|
| 31 Mar 2016 07:24 PM |
| because u are incorrectly using scripts or local scripts |
|
|
| Report Abuse |
|
|
|
| 31 Mar 2016 07:36 PM |
I don't think this script is wrong:
function onTouched(hit) game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true) end
script.Parent.Touched:connect(onTouched)
(its in a part and in a script) |
|
|
| Report Abuse |
|
|
|
| 31 Mar 2016 07:41 PM |
And yet you even managed to mess that up.
SetCore or whatever can only be used in a local script. |
|
|
| Report Abuse |
|
|
|
| 31 Mar 2016 07:54 PM |
If you want that to work, link that touched event to the player, and go from there. Not sure, but you might be able to modify the CoreGui with Player.PlayerGui:SetCoreGuiEnabled("All", false).
(Or whatever you want to make appear.)
|
|
|
| Report Abuse |
|
|
|
| 31 Mar 2016 07:54 PM |
| I also tried it on a local script m8 |
|
|
| Report Abuse |
|
|
|
| 31 Mar 2016 07:55 PM |
Of course though, that player variable will have been obtained through the touched event.
|
|
|
| Report Abuse |
|
|
|
| 31 Mar 2016 07:58 PM |
| I never used the player variable |
|
|
| Report Abuse |
|
|
|
| 31 Mar 2016 08:00 PM |
script.Parent.Touched:connect(function(player) player.PlayerGui:SetCoreGuiEnabled(Enum.CoreGuiType.Backpack, true) --no idea if this will work end) |
|
|
| Report Abuse |
|
|
ByDefault
|
  |
| Joined: 25 Jul 2014 |
| Total Posts: 3197 |
|
|
| 31 Mar 2016 08:02 PM |
:SetCoreGuiEnabled has to be used on the client (in a localscript)
I'd suggest putting a localscript in StarterPlayerScripts and handling the .touched event from there |
|
|
| Report Abuse |
|
|
|
| 31 Mar 2016 08:13 PM |
Yeah. Like, Part in Workspace. Script in Part. And a disabled LocalScript inside of the Part.
LocalScript Code: game.StarterGui:SetCoreGuiEnabled("All", false)
Script Code:
local Part = script.Parent local LocalScript = script.Parent.LocalScript function PartTouched(Leggy) if Leggy.Parent ~= nil and Leggy.Parent:IsA("Model") then local Character = Leggy.Parent local Player = Character:GetPlayerFromCharacter() local NewLocalScript = LocalScript:Clone() NewLocalScript.Parent = Player.PlayerGui NewLocalScript.Disabled = false end end Part.Touched:connect(PartTouched(Leggy))
Something like that. Was testing out in Studio. Only thing I don't understand too much is the whole PlayerGui thing. You might have to work that out there.
|
|
|
| Report Abuse |
|
|
|
| 31 Mar 2016 08:14 PM |
Oh, I was testing that out in Studio. That code is messed up... lemme fix that...
|
|
|
| Report Abuse |
|
|
|
| 31 Mar 2016 08:15 PM |
local Part = script.Parent local LocalScript = script.Parent.LocalScript Part.Touched:connect(function(Leggy) if Leggy.Parent ~= nil and Leggy.Parent:IsA("Model") then local Character = Leggy.Parent local Player = game.Players:FindFirstChild(Character.Name) local NewLocalScript = LocalScript:Clone() NewLocalScript.Parent = Player.PlayerGui NewLocalScript.Disabled = false end)
There. I think I fixed that stuff up. Definitely not going to work 100%, tho.
|
|
|
| Report Abuse |
|
|
Crimsonal
|
  |
| Joined: 23 Apr 2011 |
| Total Posts: 1795 |
|
|
| 31 Mar 2016 09:13 PM |
| idk, i guess server a client work as one, but when the game is actually on, they are seperate |
|
|
| Report Abuse |
|
|
|
| 31 Mar 2016 09:21 PM |
| Correct, Crimsonal. Studio does simulate the differences when you start a Test Server though (The feature that can have 0 or more players and starts a separate window for each) |
|
|
| Report Abuse |
|
|
|
| 01 Apr 2016 05:26 PM |
| Would this work in a local script if I make it that the tools become true if the humanoid's health is at 0?? |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
|
| 12 Apr 2016 03:23 PM |
You gotta stop bumpin' this, man. Keeps popping up in my list. >:l
|
|
|
| Report Abuse |
|
|