hii!! i’ve been trying to get a custom image for a tool buut… not working as expected. even though i can set the image in studio, it doesnt appear when playtesting OR in the game. heres the script… PLEASE HELP. IVE BEEN TRYING TO MAKE IT WORK FOR LIKE 2 DAYS.
local plr = game.Players.LocalPlayer
local tool = script.Parent
local inputs = game:GetService("UserInputService")
local currentspell = tool.currentspell
local event = tool.changespell
local gui = tool.spellpage
local mouse
local check1 = tool.check1
local check2 = tool.check2
local check3 = tool.check3
local nospell = "rbxassetid://119375355084853"
local pumpimage = "http://www.roblox.com/asset/?id=92445415345001"
local skelimage = "http://www.roblox.com/asset/?id=120653858123648"
local shieldimage = "http://www.roblox.com/asset/?id=97128960276705"
local char
local shieldan = tool:WaitForChild("shield")
local pumpkan = tool:WaitForChild("pumpkin")
local summonan = tool:WaitForChild("summon")
local shielda
local pumpa
local summona
local curmouse
local currentmousefunc
--summon to pumpkinball to shield "rbxassetid://76568679516657"
function setMousicon(icon)
if plr.PlayerGui:FindFirstChild("mausicon") then
print("ooh")
curmouse:FindFirstChild("icon").Image = icon
end
end
inputs.InputBegan:Connect(function(inp, processed)
if processed or tool.equipped.Value == false then
return
end
if inp.KeyCode == Enum.KeyCode.E then
if currentspell.Value == "summon" then
if check2.Value then
setMousicon(pumpimage)
else
setMousicon(nospell)
end
event:FireServer("pumpkin")
end
if currentspell.Value == "pumpkin" then
if check3.Value then
setMousicon(shieldimage)
else
setMousicon(nospell)
end
event:FireServer("shield")
end
if currentspell.Value == "shield" then
if check1.Value then
setMousicon(skelimage)
else
setMousicon(nospell)
end
event:FireServer("summon")
end
end
if inp.KeyCode == Enum.KeyCode.Q then
if currentspell.Value == "shield" then
if check2.Value then
setMousicon(pumpimage)
else
setMousicon(nospell)
end
event:FireServer("pumpkin")
end
if currentspell.Value == "pumpkin" then
if check1.Value then
setMousicon(skelimage)
else
setMousicon(nospell)
end
event:FireServer("summon")
end
if currentspell.Value == "summon" then
if check3.Value then
setMousicon(shieldimage)
else
setMousicon(nospell)
end
event:FireServer("shield")
end
end
end)
check1.Changed:Connect(function(val)
if currentspell.Value == "summon" then
if not val then
setMousicon(nospell)
summona:Play()
end
if val then
setMousicon(skelimage)
end
end
end)
check2.Changed:Connect(function(val)
if currentspell.Value == "pumpkin" then
if not val then
setMousicon(nospell)
pumpa:Play()
end
if val then
setMousicon(pumpimage)
end
end
end)
check3.Changed:Connect(function(val)
if currentspell.Value == "shield" then
if not val then
setMousicon(nospell)
shielda:Play()
end
if val then
setMousicon(shieldimage)
shielda:Stop()
end
end
end)
local theyloaded = false
tool.Equipped:Connect(function(maus)
char = tool.Parent
if not theyloaded then
theyloaded = true
shielda = char:FindFirstChild("Humanoid"):FindFirstChild("Animator"):LoadAnimation(shieldan)
pumpa = char:FindFirstChild("Humanoid"):FindFirstChild("Animator"):LoadAnimation(pumpkan)
summona = char:FindFirstChild("Humanoid"):FindFirstChild("Animator"):LoadAnimation(summonan)
end
mouse = maus
if currentspell.Value == "summon" then
if check1.Value then
setMousicon(skelimage)
else
setMousicon(nospell)
end
end
if currentspell.Value == "pumpkin" then
if check2.Value then
setMousicon(pumpimage)
else
setMousicon(nospell)
end
end
if currentspell.Value == "shield" then
if check3.Value then
setMousicon(shieldimage)
else
setMousicon(nospell)
end
end
gui.Parent = plr.PlayerGui
curmouse = game:FindFirstChild("ReplicatedStorage"):FindFirstChild("otherstuffs"):FindFirstChild("mausicon"):Clone()
curmouse.Parent = plr.PlayerGui
inputs.MouseIconEnabled = false
currentmousefunc = mouse.Move:Connect(function()
local loc = inputs:GetMouseLocation()
curmouse:FindFirstChild("icon").Position = UDim2.new(loc.X, loc.Y)
end)
end)
tool.Unequipped:Connect(function()
setMousicon("rbxasset://textures\\ArrowFarCursor.png")
currentmousefunc:Disconnect()
curmouse:Destroy()
inputs.MouseIconEnabled = true
gui.Parent = tool
end)
currentspell.Changed:Connect(function()
gui.Frame.pagetext.Text = ("<Q "..currentspell.Value.." E>")
end)
tool.Activated:Connect(function()
if currentspell.Value == "summon" and check1.Value then
end
if currentspell.Value == "pumpkin" and check2.Value then
end
if currentspell.Value == "shield" and check3.Value then
end
end)