Hello scripting helpers,
I just created a tool giver script, it doesn't work. The script works fine without the 4th line. The script gives the tools flawlessly.
What it's supposed to do is check if the player is in the group and is in the role 12 or higher. If so, it gives them the tools and parts. The WalkeeTalkee is a small red part what should go inside the players head. When I run the script, it gives me the 4 tools fine but the WalkeeTalkee duplicates next to the part in the workspace.
These are the descriptions:-
WalkeeTalkee -- Part Taser -- Tool HR Radio -- Tool HR Gun -- Tool Card -- Tool
Then the script:-
game.Players.PlayerAdded:connect(function(p) -- Works fine p.CharacterAdded:connect(function(pp) -- NEED HELP if tonumber(p:GetRankInGroup(1240173)) >= 12 then -- Works fine game.Workspace.WalkeeTalkee:Clone().Parent = pp.Head -- NEED HELP game.ServerStorage.HRTools.Taser:Clone().Parent = p.Backpack -- Works fine game.ServerStorage.HRTools["HR Radio"]:Clone().Parent = p.Backpack -- Works fine game.ServerStorage.HRTools["HR Gun"]:Clone().Parent = p.Backpack -- Works fine game.ServerStorage.HRTools.Card:Clone().Parent = p.Backpack -- Works fine end end) end)
Hope you help! :] Nathan.
The only thing wrong is the WalkeeTalkee. You need to make the walkeetalkee have a weld and make joints. After that you need to change the CFrame of the part to the head so the walkeetalkee isn't floating anywhere.
game.Players.PlayerAdded:connect(function(p) p.CharacterAdded:connect(function(pp) -- This is fine if tonumber(p:GetRankInGroup(1240173)) >= 12 then local walkeetalkee = game.Workspace.WalkeeTalkee:Clone() walkeetalkee.Parent = pp.Head walkeetalkee.CFrame = CFrame.new(pp.Position) --EDIT THIS pp:MakeJoints()--Make joints so it sticks. Make the walkeetalkee have a weld. game.ServerStorage.HRTools.Taser:Clone().Parent = p.Backpack game.ServerStorage.HRTools["HR Radio"]:Clone().Parent = p.Backpack game.ServerStorage.HRTools["HR Gun"]:Clone().Parent = p.Backpack game.ServerStorage.HRTools.Card:Clone().Parent = p.Backpack end end) end)
Hope it helps!