Hello, I tried to make something like this before, and didn't reach the goal yet (easy script for you)
The issue is that I don't really know how to make this happend only on (theplayer)'s screen.
Like if the command to make the sound & picture go off on a players screen, was "scare", and I did /scare Haz then the player with the namepart "Haz" got "scared". The code below is what I have, the scareImage function should be handled by a command named "scare".
Can you help?
local sw,sh = guiGetScreenSize()
function getPlayerFromPartialName(name)
local name = name and name:gsub("#%x%x%x%x%x%x", ""):lower() or nil
if name then
for _, player in ipairs(getElementsByType("player")) do
local name_ = getPlayerName(player):gsub("#%x%x%x%x%x%x", ""):lower()
if name_:find(name, 1, true) then
return player
end
end
end
end
function scareImage()
local scareSound = playSound("scare.mp3")
setSoundVolume(scareSound, 1)
dxDrawImage(math.random(-5,0),math.random(-5,0),sw+5,sh+5,'scare.jpg',0,0,0,tocolor(255,255,255,math.random(200,240)),true)
end
--addCommandHandler("scare"?????????????????????????????????????????????????)
thx