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 » Scripters
Home Search
 

Re: Equipped Event Hates Me

Previous Thread :: Next Thread 
qqtt991 is online. qqtt991
Joined: 14 Dec 2007
Total Posts: 1387
08 Nov 2016 12:49 AM
I have a Tool stored inside a folder in ServerStorage. Inside the Tool is a very complicated LocalScript, however this simpler LocalScript experiences the exact same problem:


local function onSelected()
print("Selected")
end

local function onUnselected()
print("Unselected")
end

script.Parent.Equipped:Connect(onSelected)
script.Parent.Unequipped:Connect(onUnselected)


I have a complicated morphing Server Script that runs when the player clicks a button before I clone the Tool and jam it into the player's Backpack. When the player equips the tool, absolutely nothing happens. None of the connections appear to be made, however other tools that work on the same principle work just fine. :D

I've been working on this one silly problem for about two hours. The finished tool works just fine when put into the StarterPack, or pasted into a human's Backpack, however once the player morphs, it completely gives up trying for no discernible reason.

The Player is morphed by essentially removing everything inside their Character and replacing it. The morph I'm testing this with has no named arms, nor legs (No "Right Arm"). It has a HumanoidRootPart, Torso, and Head. The morph works perfectly fine without these parts, and again, seeing as this unrelated resize tool I have works while morphed completely fine, while also doing the exact same thing my script is doing to connect everything up, this (probably) cannot be the problem.

- The Tool cannot be dropped, does not require a handle, and yes, is enabled.
- The Tool also does not do anything to the Player's Character.
- The tool is not written for FE yet, so FE is not a factor.
- No amount of wait() anywhere in the script has helped me at all.

Pls. :(


Report Abuse
DaddyNerdy is not online. DaddyNerdy
Joined: 17 Apr 2009
Total Posts: 2227
08 Nov 2016 01:21 AM
Add prints to the functions, and if prints output in the local log then it should point to your issue.


Report Abuse
qqtt991 is online. qqtt991
Joined: 14 Dec 2007
Total Posts: 1387
08 Nov 2016 02:01 AM
The simplified script already has prints, and I have already tried prints in the full script. It's narrowed down as far as I can get it, it being the connections. Placing a print outside of the functions prints just fine once the script runs, but no connections are made and nothing further happens.
Report Abuse
qqtt991 is online. qqtt991
Joined: 14 Dec 2007
Total Posts: 1387
08 Nov 2016 11:30 AM
Bump
Report Abuse
Wunder_Wulfe is online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
08 Nov 2016 12:30 PM
requires handle true if there is a Handle
false if there is not a handle

when you equip the tool it should fire anyways

or you can use Changed to detect when the parent changed
Report Abuse
qqtt991 is online. qqtt991
Joined: 14 Dec 2007
Total Posts: 1387
08 Nov 2016 01:13 PM
Changed bizarrely enough seems to work, albeit I would need to write another function to detect equipped and unequipped myself, however that feels like a very hacky solution and I'd prefer not to use it unless I have to.

There is no handle and RequiresHandle is false.

When I equip the tool, and I have said explicitly and with ample information, the functions connected to the Equipped event do not run. The only thing I can assume is happening is that the connections are not made before the tool is equipped, however not even the Unequipped function runs which surely must have been connected before the tool was unequipped, so that can't be it either?


Report Abuse
qqtt991 is online. qqtt991
Joined: 14 Dec 2007
Total Posts: 1387
08 Nov 2016 03:43 PM
Bump


Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
08 Nov 2016 03:44 PM
enable the local script when its cloned. Keep it disabled in serverstorage


Report Abuse
qqtt991 is online. qqtt991
Joined: 14 Dec 2007
Total Posts: 1387
08 Nov 2016 03:50 PM
Lmao I tried that too.
It doesn't matter how many times I disable/enable the script, destroy and clone it back into the gutted tool, change the tool's parent, clone the tool, or swear at it. The connections to the Equipped and Unequipped events just don't get made.


Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
08 Nov 2016 04:03 PM
Works fine for me.

prntscr
.
com
/d4tvs0

--server script

local tool = game.ServerStorage.Folder.Tool

game.Players.PlayerAdded:connect(function(player)
tool:Clone().Parent = player:WaitForChild('Backpack')
end)


Report Abuse
qqtt991 is online. qqtt991
Joined: 14 Dec 2007
Total Posts: 1387
08 Nov 2016 04:18 PM
Yes, but you don't have the same circumstances I do. As I've said, the tool works just fine when my player's character is unmodified, however, my player's character is not the same character it was "born" with when I need the tool. It's been heavily modified, all parts and scripts in the character removed and replaced, etc.

Upon further investigation, it actually looks like HopperBin tools work just fine! I'd much rather not use them because they're deprecated, but if no solution is found I can switch.

What's so different?
Do Tools' events rely on certain parts of the character existing? Or other hidden factors?

Morphs that have the primary body parts named properly ("Right Arm") still don't work when a Tool is used instead of a HopperBin, so it can't be that. I make sure to add the Tool to the Backpack after the morph script finishes ####### around inside the Character, so the Character's state cannot be inconsistent and breaking things. Why is everything so finicky all the time.


Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
08 Nov 2016 04:21 PM
pretty sure that if the tool isnt parented to the character/morph then the events will not fire.


Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
08 Nov 2016 04:23 PM
maybe this might help:

"The tool may equip before the script adds the connection if both are added to Workspace on another machine.
This event may not fire if the tool moves or removes before it reaches the correct state."


Report Abuse
qqtt991 is online. qqtt991
Joined: 14 Dec 2007
Total Posts: 1387
08 Nov 2016 04:30 PM
Yes I've seen that, however the first one implies that the Unequipped function would run once I unequip the tool, since it would have made the connection and the unequipped event wouldn't have fired at that point. This does not happen.

Also, I don't think the simple act of equipping the tool as is intended with it being a tool would cause the event to not fire. Wouldn't many other people have the same problem if that were the case?



Report Abuse
qqtt991 is online. qqtt991
Joined: 14 Dec 2007
Total Posts: 1387
08 Nov 2016 06:38 PM
Honk


Report Abuse
DevVince is not online. DevVince
Joined: 08 Nov 2008
Total Posts: 9245
08 Nov 2016 06:51 PM
Not going to read that but I see it says you're cloning it. Maybe this will work:

When cloning the tool have the scripts disabled then enable them once in the location?
Idk Might help just to much to read I don't like reading useless blabbing just get to the point. ;)
Report Abuse
qqtt991 is online. qqtt991
Joined: 14 Dec 2007
Total Posts: 1387
08 Nov 2016 06:53 PM
If you haven't read then your advice is completely useless and you should just go, because if you had read, then you would know that I have already tried that.

If you're not going to bother to understand the problem before you try to help, then shut up and leave.


Report Abuse
qqtt991 is online. qqtt991
Joined: 14 Dec 2007
Total Posts: 1387
08 Nov 2016 06:56 PM
Honestly. I didn't type all of that because it was good for my health. It's there because it's necessary to understand the problem, and is not "useless blabbing".

Can't stand lazy people. Christ.


Report Abuse
AuthenticGorilla64 is not online. AuthenticGorilla64
Joined: 01 Nov 2015
Total Posts: 77
08 Nov 2016 07:14 PM
Everyone's gonna be lazy when you give multiple paragraphs of unorganized information. All you did was explain what was going on, didn't give us any source code nor supplied us with important information. The only suggestion I could supply you with is the fact that you ###### removed the Right Arm which is the placeholder for tools. -- Testing with a very basic script (no handle required) script.Parent.Equipped:connect(function() print("Selected") end) script.Parent.Unequipped:connect(function() ################### end) will output selected / ########## until you remove the characters right arm. Then the character does not recognize the method.
Report Abuse
AuthenticGorilla64 is not online. AuthenticGorilla64
Joined: 01 Nov 2015
Total Posts: 77
08 Nov 2016 07:15 PM
I guess de-selected in its full form isn't viable for roblox censorship nice one
Report Abuse
qqtt991 is online. qqtt991
Joined: 14 Dec 2007
Total Posts: 1387
08 Nov 2016 07:27 PM
[REDACTED]
Report Abuse
qqtt991 is online. qqtt991
Joined: 14 Dec 2007
Total Posts: 1387
08 Nov 2016 07:28 PM
???????????????????????????


Report Abuse
qqtt991 is online. qqtt991
Joined: 14 Dec 2007
Total Posts: 1387
08 Nov 2016 07:29 PM
The "unorganized information" is exactly what you need to understand what's going on and IS the "important information".

If you had read you'd see that the problem has absolutely nothing to do with the body of the code, so you don't need it.

If you had read you'd also see that I have in fact, tested with and without properly named primary body parts. Having a named Right Arm in the morph did not solve any of my woes.


However, at some point while smashing my face repeatedly into your post, it occurred to me to try renaming the Motor6D connecting the Torso to the Right Arm in a morph with arms to the name "Right Shoulder". So thanks I guess. The absence of a Right Arm was not the problem. The absence of a named Right Shoulder was the problem.

This made the tool work properly and has solved my problem.
In hindsight this is obvious, because if your arm gets blown off and the Motor6D is destroyed, you logically shouldn't be able to use a tool with a handle, however I think it is absurd for you to need arms at all to use tools that don't have handles.


Report Abuse
TimeTicks is not online. TimeTicks
Joined: 27 Apr 2011
Total Posts: 27115
08 Nov 2016 07:49 PM
@qqtt I'm glad you solved your problem. Yes it does seem silly, and maybe that is something they can change in the future. Good luck.


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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