This is me reposting my other question in more detail!
Probably a big topic, but I was browsing around the internet for scripting lessons on making advanced swords and stuff, and all I saw was scripting for beginners and things like that. For example, in the game 'Black Magic', they have weapons with showing damage numbers, and hotkey actions. I'm looking for a tutorial on how to do those two things, but so far I've found nothing. Here are some example of scripts I think I can use for this situation, this first script-box shows creating a damage gui:
function billboard(pos,text,time,color)
local pos=pos or Vector3.new(0,0,0)
local text=text or "Hello World!"
local time=time or 2
local color=color or Color3.new(1,1,0)
local pos=pos+Vector3.new(0,5,0)
local ep=Instance.new("Part")
ep.Name="Effect"
ep.formFactor="Custom"
ep.Size=Vector3.new(0,0,0)
ep.TopSurface="Smooth"
ep.BottomSurface="Smooth"
ep.CFrame=CFrame.new(pos)
ep.Anchored=true
ep.CanCollide=false
ep.Transparency=1
local bb=Instance.new("BillboardGui")
bb.Size=UDim2.new(3,0,3,0)
bb.Adornee=ep
local tl=Instance.new("TextLabel")
tl.BackgroundTransparency=1
tl.Size=UDim2.new(1,0,1,0)
tl.Text=text
tl.TextColor3=color
tl.TextScaled=true
tl.Font="ArialBold"
tl.TextStrokeTransparency = 0
tl.Parent=bb
bb.Parent=ep
debris:AddItem(ep,time+.1)
ep.Parent=game.Workspace
delay(0,function()
local frames=time/rate
for frame=1,frames do
wait(rate)
local percent=frame/frames
ep.CFrame=CFrame.new(pos)+Vector3.new(0,5*percent,0)
tl.TextTransparency=percent
end
ep:remove()
end)
end
Im still not sure how to make OnKey functions yet, that would also be helpful! Other than just having regular attacks, mabey an action on pressing Q or E or something like that might work, here's what I think:
local Key = value.Key
local Down = value.Down
if Key == "q" and Down then
Is that the right one? Well, thank you for reading, if you have an answer then put it in the reply box below!
