×

Langue

Fermer
Atelier 801
  • Forums
  • Dev Tracker
  • Connexion
    • English Français
      Português do Brasil Español
      Türkçe Polski
      Magyar Română
      العربية Skandinavisk
      Nederlands Deutsch
      Bahasa Indonesia Русский
      中文 Filipino
      Lietuvių kalba 日本語
      Suomi עברית
      Italiano Česky
      Hrvatski Slovensky
      Български Latviešu
      Estonian
  • Langue
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • Script Requests
« ‹ 155 / 160 › »
Script Requests
Shadiiii
« Citoyen »
1560679980000
    • Shadiiii#5522
    • Profil
    • Derniers messages
    • Tribu
#3081
  1
Second_life a dit :
i think its not possible but im gonna ask anyway. If i have like 150 score then i click a textArea after that it would do this :
tfm.exec.setPlayerScore("Second_life #7503", 1, true)
if it's not possible it's okay.

eventTextAreaCallback ( textAreaId, playerName, eventName )
Overjoy06
« Citoyen »
1561107120000
    • Overjoy06#0000
    • Profil
    • Derniers messages
    • Tribu
#3082
  0
Second_life a dit :
i think its not possible but im gonna ask anyway. If i have like 150 score then i click a textArea after that it would do this :
tfm.exec.setPlayerScore("Second_life #7503", 1, true)
if it's not possible it's okay.

Code Lua

1
2
3
4
5
6
7
ui.addTextArea(0,"<a href='event:score'>I really don't understand anything in my life",name, 250,250,250,250,0x000000,0x000000,9,true)

function eventTextArea(id, name, evt)
if evt == "score" then
tfm.exec.setPlayerScore("Second_life #7503", 1, true)
end
end

Should work if i have enough IQ
Radioactium
« Citoyen »
1561434780000
    • Radioactium#0000
    • Profil
    • Derniers messages
    • Tribu
#3083
  0
Hi it would be very helpful if I could have a voting script similar to #traitor, where
1. Any player in the room can vote for only one player other than themselves with the command !vote [playerName] or !v [playerName]
2. A player can change their vote with the same command
3. A player can cancel their vote by voting for the same player twice (!vote Rad#0000 will give Rad a vote, invoking !vote Rad#0000 again will take away a vote from Rad)
4. The tfm player scoreboard will keep track of how many votes each player has
Onkei
« Citoyen »
1561452900000
    • Onkei#0000
    • Profil
    • Derniers messages
    • Tribu
#3084
  0
Radioactium a dit :
Hi it would be very helpful if I could have a voting script similar to #traitor, where
1. Any player in the room can vote for only one player other than themselves with the command !vote [playerName] or !v [playerName]
2. A player can change their vote with the same command
3. A player can cancel their vote by voting for the same player twice (!vote Rad#0000 will give Rad a vote, invoking !vote Rad#0000 again will take away a vote from Rad)
4. The tfm player scoreboard will keep track of how many votes each player has

Untested, but you should be able to also reset votes doing !reset


Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
local admin = { ["Radioactium#0000"] = true }

local votes, voted = {}, {}
function voteForPlayer(voting, votingFor)

if voting == votingFor then
return;

elseif voted[voting] then
-- Voted before

local previouslyVoted = voted[voting]
votes[previouslyVoted] = votes[previouslyVoted] - 1
voted[voting] = false
tfm.exec.setPlayerScore(previouslyVoted, votes[previouslyVoted], false)

if votingFor == previouslyVoted then
-- Cancel vote
return;
end
end

if not votes[votingFor] then
votes[votingFor] = 0
end

votes[votingFor] = votes[votingFor] + 1
voted[voting] = votingFor
tfm.exec.setPlayerScore(votingFor, votes[votingFor], false)
end

function resetVotes()
votes = {}
voted = {}

for name in next, tfm.get.room.playerList do
tfm.exec.setPlayerScore(name, 0, false)
end
end

function eventChatCommand(name, cmd)

if admin[name] and cmd == "reset" then
resetVotes()
end

local arg = {}
for args in cmd:gmatch("[^%s]+") do
table.insert(arg, args:lower())
end

if (arg[1] == "vote" or arg[1] == "v") and arg[2] then
local votingFor = tostring(arg[2])
if votingFor and tfm.get.room.playerList[votingFor] then
voteForPlayer(name, votingFor)
end
end
end

resetVotes()
Second_life
« Citoyen »
1561951320000
    • Second_life#7503
    • Profil
    • Derniers messages
    • Tribu
#3085
  0
no i meant if you have 100 points and you clicked a textArea you get 1 point every 5 second
Coreful
« Censeur »
1563928980000
    • Coreful#1043
    • Profil
    • Derniers messages
    • Tribu
#3086
  0
Edit: Nevermind, thanks!

Dernière modification le 1564077540000
Lil
« Citoyen »
1564496340000
    • Lil#5937
    • Profil
    • Derniers messages
    • Tribu
#3087
  0
i want change player names how can i do that
Boxofkrain
« Censeur »
1564496460000
    • Boxofkrain#0000
    • Profil
    • Derniers messages
    • Tribu
#3088
  0
Lil a dit :
i want change player names how can i do that

You can't do it in Lua :/
Dramacorn
« Consul »
1564737060000
    • Dramacorn#2857
    • Profil
    • Derniers messages
    • Tribu
#3089
  0
who have the script with Halloween cheats?
Overjoy06
« Citoyen »
1564819740000
    • Overjoy06#0000
    • Profil
    • Derniers messages
    • Tribu
#3090
  0
Dramacorn a dit :
who have the script with Halloween cheats?

What do you mean by 'Halloween cheats' like flying codes or something else?
Dramacorn
« Consul »
1564911480000
    • Dramacorn#2857
    • Profil
    • Derniers messages
    • Tribu
#3091
  0
The Gamble from map bar..

Dernière modification le 1565438820000
Overforyou
« Citoyen »
1567924320000
    • Overforyou#9290
    • Profil
    • Derniers messages
    • Tribu
#3092
  0
Dramacorn a dit :
The Gamble from map bar..

I didn't see any scripts similar to your request but you can make your own gambling system or request for one
Cyanny
« Citoyen »
1567981800000
    • Cyanny#0000
    • Profil
    • Derniers messages
    • Tribu
#3093
  0
Second_life a dit :
no i meant if you have 100 points and you clicked a textArea you get 1 point every 5 second

I don't know if it's too late, but here you go:
LUA
room = {}
ui.addTextArea(0, "<p align='center'><a href='event:oneplus'>Gimme an extra point!</a></p>", nil, 560, 380, 180, 100, nil, nil, 1, true)

function eventTextAreaCallback(textArea, player, callback)
if tfm.get.room.playerList[player].score >= 100 then
room[player] = {givePoints=true,t=0}
end
end

function eventLoop(ct, tr)
for k,v in pairs(room) do
if tfm.get.room.playerList[k].score < 100 then
v = {givePoints=false,t=0}
end
if v.givePoints then
v.t = v.t + 0.5
if v.t % 5 == 0 then
tfm.exec.setPlayerScore(k, tfm.get.room.playerList[k].score + 1)
end
end
end
end

I hope it works as intended.

Dernière modification le 1567981980000
Overforyou
1569841800000
    • Overforyou#9290
    • Profil
    • Derniers messages
    • Tribu
#3094
[Modéré par Inkzooka, raison : Off-topic]
Zyx
« Censeur »
1573252320000
    • Zyx#8690
    • Profil
    • Derniers messages
#3095
  0
a script that picks up on tribe house commands made by players, such as /np, /ch, /module x, etc and puts them into a log for the person loading the code

Dernière modification le 1573253640000
Boxofkrain
« Censeur »
1573289220000
    • Boxofkrain#0000
    • Profil
    • Derniers messages
    • Tribu
#3096
  0
Zyx a dit :
a script that picks up on tribe house commands made by players, such as /np, /ch, /module x, etc and puts them into a log for the person loading the code

Unfortunately, you can't get the name of player who used a built-in tribe command.
Bursia
« Citoyen »
1577527980000
    • Bursia#0000
    • Profil
    • Derniers messages
    • Tribu
#3097
  0
Hello. How do I create a box with a red nail?
Bolodefchoco
« Sénateur »
1577538180000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#3098
  0
Bursia a dit :
Hello. How do I create a box with a red nail?

You can't use nails with lua
Aen_elle
« Citoyen »
1582400100000
    • Aen_elle#0000
    • Profil
    • Derniers messages
    • Tribu
#3099
  0
Hi,
Don't find a specific theme, so:
1) Any way to show different information in textArea for different players?
2) Have a script that add shamanObject every click, and delete previous obj with that id:
1
2
tfm.exec.removeObject(id)
id=tfm.exec.addShamanObject(6,xMousePosition,yMousePosition,0,let_power,let_power,false)
Any way to create different id for different playerName? (mean that different players will not delete each other's objects)
3) Any event for object, when it have some coordinates? (for example, box spawn at some area trigger an event)

Does #module team have access to functions, except events that we can find here? or is it the maximum development opportunity for mere mortals usual players?
Bolodefchoco
« Sénateur »
1582412400000
    • Bolodefchoco#0095
    • Profil
    • Derniers messages
    • Tribu
#3100
  1
Aen_elle a dit :
Hi,
Don't find a specific theme, so:
1) Any way to show different information in textArea for different players?
2) Have a script that add shamanObject every click, and delete previous obj with that id:
1
2
tfm.exec.removeObject(id)
id=tfm.exec.addShamanObject(6,xMousePosition,yMousePosition,0,let_power,let_power,false)
Any way to create different id for different playerName? (mean that different players will not delete each other's objects)
3) Any event for object, when it have some coordinates? (for example, box spawn at some area trigger an event)

Does #module team have access to functions, except events that we can find here? or is it the maximum development opportunity for mere mortals usual players?

Hello!

1) Textareas can be displayed to specific players by passing their nickname as third parameter, example:
Code Lua

1
2
3
ui.addTextArea(0, "Text A", "Bolodefchoco#0000", 10, 10, nil, nil, 1, 1, 1, true) -- This textarea only appears to me
ui.addTextArea(1, "Text B", "Aen_elle#0000", 10, 50, nil, nil, 1, 1, 1, true) -- This textarea only appears to you
ui.addTextArea(2, "Text C", nil, 10, 100, nil, nil, 1, 1, 1, true) -- This textarea appears to everyone

2) You need to attach the id to the player's nickname, use a table for that.
Code Lua

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
local playerData = { } -- where the ids will be located

eventNewPlayer = function(playerName) -- event when someone joins the room
system.bindMouse(playerName, true) -- allow this player to click
end
for playerName in next, tfm.get.room.playerList -- gets all players that are already in the room
eventNewPlayer(playerName) -- and does the same things as if they just had joined the room
end

eventMouse = function(playerName, x, y) -- event when a player clicks
if playerData[playerName] then -- checks if there is an ID attached to that nickname
tfm.exec.removeObject(playerData[playerName]) -- if so, removes the object
end

playerData[playerName] = tfm.exec.addShamanObject(6, x, y) -- creates a new object and attachs the returned id to the player name
end

-- Optional
eventNewGame = function()
playerData = { } -- resets the playerData table because all objects (IDs) of the previous map were automatically removed by the game
end

3) You need to use eventSummoningEnd (when an object has spawned by the shaman)

Code Lua

1
2
3
4
5
eventSummoningEnd = function(playerName, objectType, x, y)
if x >= 10 and x <= 60 then
print("the object has been spawned between the X coordinates 10 and 60")
end
end

You can use the same x and y logic in eventMouse or any other similar chunk

About the functions, kinda yes. That thread is pretty outdated. Check The official one to get to know about all functions and events.

The module team have them all and nothing more. :(
  • Forums
  • /
  • Transformice
  • /
  • Modules
  • /
  • Script Requests
« ‹ 155 / 160 › »
© Atelier801 2018

Equipe Conditions Générales d'Utilisation Politique de Confidentialité Contact

Version 1.27