|
| 20 Sep 2015 10:36 AM |
How would I do that exactly? I found that changing the mouse icon and going back instantly doesn't help to well and breaks it. What should I do?
-- damage=100
debris=game:GetService("Debris") local HitMarker = "http://www.roblox.com/asset/?id=176124496" local player = game.Players.LocalPlayer local Mouse = player:GetMouse()
local h=hit.Parent:FindFirstChild("Humanoid")
if h.Health > damage then local currentPic = Mouse.Icon Mouse.Icon = HitMarker local HitSound = script.HitSound:Clone() HitSound.Parent = player.PlayerGui HitSound:Play() delay(0.05, function() Mouse.Icon = currentPic HitSound:Destroy() end) end |
|
|
| Report Abuse |
|
|
| |
|
|
| 20 Sep 2015 10:37 AM |
| How would I keep the gui positioned on that mouse? |
|
|
| Report Abuse |
|
|
| |
|
Posuceius
|
  |
| Joined: 07 Apr 2010 |
| Total Posts: 267 |
|
|
| 20 Sep 2015 10:42 AM |
mouse.Icon = "rbxasset"
just make it change the icon of the mouse whenever you deal damage to a player |
|
|
| Report Abuse |
|
|
|
| 20 Sep 2015 11:16 AM |
| I do that but it no work for some reason. |
|
|
| Report Abuse |
|
|
Posuceius
|
  |
| Joined: 07 Apr 2010 |
| Total Posts: 267 |
|
|
| 20 Sep 2015 11:19 AM |
I'm not too savvy at Lua myself, but from what I can see I believe the problem lies in your "local Mouse = player:GetMouse()"
Perhaps try removing that and then changing your "Mouse.Icon = HitMarker" to "mouse.Icon = HitMarker", since mouse is already a variable in ROBLOX. |
|
|
| Report Abuse |
|
|
|
| 20 Sep 2015 11:28 AM |
You'd create a gui that is positioned right where the mouse is. To center this hitmarker gui to the center of the mouse you'd go
local mouse = game.Players.LocalPlayer:GetMouse() hitMarker.Position = UDim2.new(0,mouse.Position.X - hitMarker.Size.X.Offset/2,0,mouse.Position.Y - hitMarker.Size.Y.Offset/2)
something like that.. you subtract the half of the size so its exactly in the center :D |
|
|
| Report Abuse |
|
|
RektHelm
|
  |
| Joined: 25 Aug 2012 |
| Total Posts: 899 |
|
|
| 20 Sep 2015 12:11 PM |
What I use. local humanoids = {} local hm = script.Hitmarker
function iterate(p) print("Finding humanoids....") for i,v in pairs(p:GetChildren()) do if v:IsA("Humanoid") and not humanoids[v] then humanoids[v] = true print("Found a humanoid in " .. v.Parent.Name .. ".") end if #v:GetChildren() > 0 then wait() iterate(v) end end end
function FadeOut(g) for i,v in pairs(g:GetChildren()) do coroutine.resume(coroutine.create(function() local x = v for i = 0, 1, .1 do x.BackgroundTransparency = i wait() end x:Destroy() end)) end repeat wait() until #g:GetChildren() == 0 g:Destroy() end
function Connect() for i,v in pairs(humanoids) do i.ChildAdded:connect(function(c) if c.Name == "creator" then print("Creator added!") local player = c.Value if player then local h = hm:Clone() h.Parent = player.PlayerGui wait(.5) coroutine.resume(coroutine.create(function() FadeOut(h) end)) end end end) end end
local b = tick() iterate(Workspace) print("Time taken to get humanoids: " .. tick()-b)
for i,v in pairs(humanoids) do print(i) end
Connect()
do Game.Players.PlayerAdded:wait() iterate(Workspace) Connect() end |
|
|
| Report Abuse |
|
|
|
| 20 Sep 2015 12:13 PM |
"mouse is already a variable in roblox" what when
http://www.roblox.com/--item?id=130759239 |
|
|
| Report Abuse |
|
|