The squad initially consisted of four clone commandos that were designed with genetic mutations and led by Clone Sergeant " Hunter," a clone with enhanced sensory abilities. The Bad Batch, formerly known as Clone Force 99, and designated as Experimental Unit Clone Force 99, was a clone commando special forces squad that was active during the Clone Wars. Local torso = char.Torso - Works only for R6Īdd that all up, and that should be a go for you.Lama Su: " They could be an asset to your new Empire." Wilhuff Tarkin: " Yet reports indicate they exhibit a concerning level of disobedience and disregard for orders." Nala Se: " A side effect of their mutation." Lama Su: " Yet one that has never hindered the completion of their missions." ―Lama Su, Wilhuff Tarkin, and Nala Se discuss Clone Force 99 If char:FindFirstChildOfClass("Humanoid") then clickDetector.MouseClick:Connect(function (plr) In this case, parenting and then welding is okay to do as welds need a frame to attach to a player. For example, before attaching the armour, make sure to clone it. clickDetector.MouseClick:Connect(function (plr)Īnd then finally, from your actual code, that’s where you can work with all the variables you’ve gotten so far and applicable advice above. You already have the player, so you can just get their character directly. PlayerWhoClicked is the argument plr in your function, not a property of the ClickDetector. Now from your ClickDetector, this is where you could reference ClickDetector documentation and perhaps also some help from PiL. local armor = game:GetService("ServerStorage").Chestpiece Just reference it here and when you actually want to attach it to someone, then go ahead and clone it. Seeing the way that you’ve put this script together, it looks like you want to give this armour to players whenever they click, however this’ll only work once and shift the cloned instance between players. local clickDetector = Instance.new("ClickDetector")ĬlickDetector.Parent = button - Is "button" ever defined in your script? To this end, you would just have to flip your code around. If you care at all about performance, please only use the first option - I wi… Local obj = Instance.new(‘type’, parent) fill obj fields Local obj = Instance.new(‘type’) fill obj fields Tthere are several ways to create a ROBLOX object in Lua: I’ve discovered a pretty bad performance issue in one of top games that has to do with Instance.new and wanted to write about this, since this is not obvious unless you know the system inside out. PSA: Don't use Instance.new() with parent argument Announcements If char.Parent:FindFirstChild("Humanoid")then -finds who clicked the buttonĬlonedArmor.CFrame = chest.CFrame -maps armor onto players chest Local clonedArmor = :Clone()ĬlickDetector.MouseClick:Connect(function(plr) -activates when clicked Local clickDetector = Instance.new("ClickDetector")ĬlickDetector.MaxActivationDwistance = 10 Here's my code: local button = script.Parent When I run it, I recieve no errors but nothing happens either. I tried making an armor giver that when clicked by a player clones the piece of armor (a block stored in the ServerStorage) and welds it to their torso. On my first day, I threw this together based off of a few freemodels and tutorials I modified, so I apologize if I’m misusing certain properties or going in the completely wrong direction.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |