I was trying to make ranking sticks in I got this error
Can we see the script?
What your going to need to do to print the users name in the Dev Console is this:
print ("Player.name..' text here'
Come back here if you have any more issues and I’ll try to help.
Question: Why would you do this?
local AstraRanking = require(script["Astra Ranking Module"])
sword = script.Parent.Handle
Tool = script.Parent
cooldown = true
function LookRole(player)
local Groups = game:GetService("GroupService"):GetGroupsAsync(player.UserId)
for i=1, #Groups do
if Groups[i].Name == "Outback® Steakhouse" then
return Groups[i].Role
end
end
return "Guest"
end
local SlashSound = Instance.new("Sound")
SlashSound.SoundId = "http://www.roblox.com/Asset/?ID=11949128"
SlashSound.Parent = sword
SlashSound.Volume = .7
function attack()
SlashSound:play()
local anim = Instance.new("StringValue")
anim.Name = "toolanim"
anim.Value = "Slash"
anim.Parent = Tool
end
function swordUp()
Tool.GripForward = Vector3.new(-1,0,0)
Tool.GripRight = Vector3.new(0,1,0)
Tool.GripUp = Vector3.new(0,0,1)
end
function swordOut()
Tool.GripForward = Vector3.new(0,0,1)
Tool.GripRight = Vector3.new(0,-1,0)
Tool.GripUp = Vector3.new(-1,0,0)
end
Tool.Enabled = true
function onActivated()
if game.Players:GetPlayerFromCharacter(script.Parent.Parent):GetRankInGroup(3172904) < 4 then
script.Parent:Destroy()
end
if not Tool.Enabled then
return
end
Tool.Enabled = false
local character = Tool.Parent;
local humanoid = character.Humanoid
if humanoid == nil then
return
end
attack()
wait(.5)
Tool.Enabled = true
end
function onEquipped()
SlashSound:play()
end
script.Parent.Activated:connect(onActivated)
script.Parent.Equipped:connect(onEquipped)
script.Parent.Handle.Touched:connect(function(otherPart)
if Tool.Enabled == false then
if otherPart.Parent ~= script.Parent.Parent then
if otherPart.Parent:FindFirstChild("Humanoid") then
local player = game.Players:GetPlayerFromCharacter(otherPart.Parent)
local user = game.Players:GetPlayerFromCharacter(script.Parent.Parent)
local userId = player.UserId
local old = LookRole(player)
AstraRanking.Demote(8653485, player.UserId)
local new = LookRole(player)
local Pos = player.Character.Torso.Position
player:LoadCharacter()
local PChar = game.Workspace:WaitForChild(player.Name)
PChar.HumanoidRootPart.CFrame = CFrame.new(Pos)
game:GetService("ReplicatedStorage").Sticks:FireClient(user,"Confirm","Confirmation message",player.Name.." has been promoted from "..old.." to "..new.."!")
game:GetService("ReplicatedStorage").Sticks:FireClient(player,"Promoted","You've been promoted!","Congratulations, "..user.Name.." promoted you from "..old.." to "..new.."!")
Tool.Name = "(2)"
wait(0.5)
Tool.Name = "(1)"
wait(0.5)
player:Kick("Passed")
Tool.Name = "Pass"
end
end
end
end)
Code tags all the way please.
how do I do code tags
For your user.Name
function, you should try and do it with the Player.name
function instead. I can assure you that you will still get the same result as using the user.Name function.
Is the a local script?
This topic was automatically closed after 7 days. New replies are no longer allowed.